Machine Learning Overview: Applications and Data Preprocessing PDF
Document Details
![JubilantAllusion6152](https://quizgecko.com/images/avatars/avatar-7.webp)
Uploaded by JubilantAllusion6152
RV University
Tags
Related
- Artificial Intelligence with Machine Learning (Unit 1) PDF
- Unit 1 - Introduction to Machine Learning PDF
- Neuroimaging Survey on Autism Spectrum Disorder Detection PDF
- V Semester Diploma Make-Up Examination, July 2024 Artificial Intelligence & Data Science PDF
- CPCS-335 Introduction to Artificial Intelligence Lecture 8 PDF
- Artificial Intelligence - Master 2 - University of Science and Technology Mohamed-Boudiaf - Chapter VI PDF
Summary
This document provides an overview of machine learning, covering key concepts of artificial intelligence, computer vision, data preprocessing, and various algorithms. It includes examples of regression, classification, clustering, and other topics, making it an educational resource for students.
Full Transcript
Overview of Machine Learning & Its Applications and Data Preprocessing Outline Brief history of Artificial intelligence and machine learning Definition and types of machine learning — Supervised Learning — Unsupervised Learning — Reinforcement Learning Applications of...
Overview of Machine Learning & Its Applications and Data Preprocessing Outline Brief history of Artificial intelligence and machine learning Definition and types of machine learning — Supervised Learning — Unsupervised Learning — Reinforcement Learning Applications of machine learning — Natural Language Processing (NLP) — Computer Vision (CV) Data Preprocessing — 2 Artificial Intelligence The term artificial intelligence was first coined in 1956 at the Dartmouth conference. Definitions: Homo sapiens (human beings) are able to control (and exploit) other species and nature because of their thinking capability. We call programs intelligent if they exhibit behaviors that would be regarded as intelligent if they were exhibited by human beings. – Herbert Simon AI is the study of techniques for solving exponentially hard problems in polynomial time by exploiting knowledge about the problem domain. – Elaine Rich 3 Human Intelligence vs Artificial Intelligence Humans have the ability to learn and apply knowledge and skills. Recreate human intelligence in computers (in general, machines) Source: Internet 4 Classical problems in AI Turing Test https://en.wikipedia.org/wiki/Turing_test https://www.investopedia.com/terms/t/turing-test.asp 5 Classical problems in AI Source: https://en.wikipedia.org/wiki/Turing_test 6 The Chinese Room Argument Can an agent locked in a room processing questions in Chinese based on a set of syntactic rules be said to understand Chinese? How many rules will the agent need to have for the thought experiment to be convincing? Searle, John R. "Minds, brains, and programs." Machine Intelligence. Routledge, 2012. 64-88. https://tinyurl.com/yfwwn4fe 7 Topics in AI Source: Deepak Khemani, A First Course on Artificial Intelligence 8 Machine Learning is a sub-field of AI Source: https://blogsinsider.blogspot.com/2018/10/relationship-between-ai-ml-dl.html 9 Machine Learning Machine learning (ML) is a branch of artificial intelligence (AI) that allows computers to learn from data and past experiences to make predictions. Initially, the model will be trained on training data. Later, it will be tested on unseen data. https://vitalflux.com/difference-between-machine-learning-traditional-software/ 10 Machine Learning History 1950s Arthur Samuel - Checker’s program 1960s Neural Network - Rosenblatt’s Perceptron, Minsky et. al. prove the limitations of Perceptron 1970s AI Winter - AAAI 1980s Backpropagation - David Rumelhart et al. 1990s Support Vector Machines 2010s Deep Learning 2020s Generative AI Dataset 12 Types of Learning Algorithms Deductive Learning — Rules of the game are (hard coded) given ahead. For example, an algorithm to multiplying numbers is given. Given any two numbers, you can apply this and get the answer. Inductive Learning — We are given examples (not the concept). We need to learn the mapping from input to output. For example, supervised learning problems come under this. 13 Types of Machine Learning Algorithms Source: which-machine-learning-algorithm-should-you-use-by-problem-type-a53967326566 14 Types of Machine Learning Algorithms Examples: Regression Supervised Learning Algorithm Predict — A continuous variable’s value ◦ Employee Salary : as a function of the employee’s experience ◦ Price of a bike: as a function of the age of the bike Machine Learning model — y = f(x) — Salary = f(experience) f = w0 + w1x (1) Here f is dependent (output), x is independent (input) variables. w0 is is y-axis intercept, and w1 is coefficient. 16 Examples: Classification Supervised Learning Algorithm Predict — A binary (discrete) variable’s value ◦ Given image is outdoor or indoor ◦ Personal loan can be application can be approved or not ◦ Given cancer cell is benign or malignant 17 Examples: Clustering Un-supervised Learning Algorithm No variable to predict but required to find the common pattern to group — Grouping different customers based on income and spending Source: https://analyticsindiamag.com/comparison-of-k-means-hierarchical- clustering-in-customer-segmentation/ 18 Examples: Association Rule Learning Un-Supervised Learning Algorithm Recommender Systems Source: https://imurgence.com/home/blog/association-rule-mining-for-collaborative-filtering 19 Examples: Reinforcement Learning Learning is through reward and penalty. Source: https://thinkinfi.com/what-is-reinforcement-learning-in-machine-learning/ 20 Spectrum of Supervision 21 Applications of Machine Learning: NLP Natural Language Processing (NLP): is a branch of computer science and artificial intelligence (AI) that allows computers to understand text and spoken words. NLP combines computer science, linguistics, and machine learning to study how computers and humans communicate. Sentiment analysis: determines whether data is positive, negative, or neutral. Text summarization: condenses a piece of text to a shorter version while preserving the meaning of the content. This technique is used in news headlines, result snippets in web search, and bulletins of market reports. Machine translation: automatically translates text from one language to another. 22 Sentiment analysis Sentiment analysis: determines whether data is positive, negative, or neutral. This technique is often used to help businesses understand customer needs and monitor brand and product sentiment. Source: https://www.expressanalytics.com/blog/social-media-sentiment-analysis/ 23 Language Translation Automatically translates text from one language to another. This technique involves using NLP techniques to understand the structure and meaning of the original text, and then generating a translation that conveys the same meaning in the target language. 24 Applications of Machine Learning: Computer Vision Computer vision is a field of artificial intelligence (AI) that trains computers to understand and interpret the visual world. It uses digital images and deep learning models to identify and classify objects, and then react to what it ”sees” Facial recognition: Identifying individuals through visual analysis Self-driving cars: Using computer vision to navigate and avoid obstacles Robotic automation: Enabling robots to perform tasks and make decisions based on visual input Person detection: Performing person detection for intelligent perimeter monitoring Medical imaging: Using computer vision for medical imaging, diagnostic applications, cancer screening, surgery, research, and identifying trends Agriculture: Using computer vision to identify product defects, sort produce, and detect diseases and low water areas 25 Applications of Machine Learning: Computer Vision Object recognition Object detection Source: https://towardsdatascience.com/object-localization-in-overfeat-5bb2f7328b62 26 Object Recognition Map any given sample to one of the category Source: https://link.springer.com/chapter 27 Object detection Map any given sample to one of the categories and also localize the objects Model: https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB 28 Object detection Model: https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB 29 Object detection Model: https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB 30 Object detection Model: https://github.com/Linzaer/Ultra-Light-Fast-Generic-Face-Detector-1MB 31 Object detection + key points estimation Map any given sample to one of the categories and also localize the objects. And also predict the face landmarks. Model: https://github.com/serengil/retinaface 32 Object detection + key points estimation Model: https://github.com/serengil/retinaface 33 Object detection + key points estimation Model: https://github.com/serengil/retinaface 34 Object detection + key points estimation Model: https://github.com/serengil/retinaface 35 Object detection + key points estimation Model: https://github.com/serengil/retinaface 36 Object Generation Model: https://github.com/junyanz/pytorch-CycleGAN-and-pix2pix?tab=readme-ov-file https://this-person-does-not-exist.com/en 37 Object Generation Image to Sketch Generation Model: https://sketchmypic.com/ 38 Data Preprocessing Data and Types of data Data refers to a set of observations or measurements that can be used to train & test an ML model. Data can be any unprocessed value, text, speech, image, or video. Figure: Various types of data Source: https://byjus.com/maths/types-of-data-in-statistics/ 3 Data and Types of data Nominal Data (Categorical Data): Data that represents categories without any inherent order or ranking. Examples: Gender (Male, Female), Colors (Red, Blue, Green) Ordinal Data: Data that represents categories with a meaningful order or ranking. Examples: Education level (High School < Bachelor's < Master's < Ph.D.) Discrete Data: Numerical data that can take on only specific, distinct values. Examples: Number of cars in a parking lot, number of students in a class. Continuous Data: Numerical data that can take any value within a given range, often involving decimals.Examples: Height, Weight, Temperature, Time. 3 Why is data preprocessing required? Raw data quality is very poor. Real-world datasets—noisy, missing, inconsistent. Source: http://tinyurl.com/ysbchrj4 5 Handling Missing data Missing data, also known as missing values, is where some of the observations in a data set are blank Delete the missing values. — Delete entire row — Delete entire column Imputing the missing values. — Replacing with an arbitrary value say 0. — Replace with a central tendency measure for that column. Image Source: https://www.analyticsvidhya.com/blog/2021/10/handling-missing-value/ 6 Scaling and Normalization Data scaling is a data preprocessing technique used to transform the values of features in a dataset to a similar scale. Why data scaling? — to ensure that all features contribute equally to the model and to avoid the domination of features with larger values. — to reduce the impact of outliers on model performance. — Faster model convergence (will discuss more on this in future classes) Data Scaling Methods — Normalization — Standardization 7 Importance of Feature Scaling Predicting House Prices Features: Number of bedrooms (ranges from 1 to 10) and house size in square feet (ranges from 500 to 5000). Without Scaling: The model might give more importance to the house size because its values are much larger, even if the number of bedrooms is equally important in predicting house prices. With Scaling: Both features are scaled to a similar range (e.g., 0 to 1 or standardized), ensuring that both contribute equally to the model. Normalization The goal of normalization is to transform features to be on a similar scale. Min-max normalization: transforming feature values from their natural range (for example, 100 to 900) into a standard range—usually [0, 1] (or sometimes [-1,1]). (1) To rescale the feature values between arbitrary values [a,b]: (2) Min-max normalization is suggested when the feature is more or less uniformly distributed across a fixed range. 8 Standardization Feature standardization makes the values of each feature in the data have zero-mean and unit-variance. This is also called as Z-Score normalization. Standardization is another scaling method where the values are centered around zero mean with a unit standard deviation. Image Source: https://www.simplilearn.com/normalization-vs- x−µ (3) x1 = σ standardization-article µ represents the mean of the feature values and σ is standard deviation. 9 Numerical on Feature scaling Consider the data: X_ORIG X_minmax X_stan 4,8,6,5,3,7 Min = 3, Max = 8 4 0.2 -0.87 Mean = 5.5, Variance = 2.92, 8 1 1.46 Standard deviation = 1.71 6 0.6 0.29 5 0.4 -0.29 3 0 -1.46 7 0.8 0.87 Normalization vs. Standardization Normalization Standardization Rescales values to a range between 0 and 1 Centers data around zero mean and scales to a standard deviation of 1 Sensitive to outliers Less sensitive to outliers Retains the shape of the original distribution Changes the shape of the original distribution When the feature is more-or-less uniformly When the feature distribution contain outliers distributed across a fixed range Dealing with Outliers Another data preprocessing step is detecting and handling the outliers as they can negatively affect the training process of a machine learning models resulting in lower accuracy. Consider a small dataset, sample= [15, 101, 18, 7, 13, 16, 11, 21, 5, 15, 10, 9]. Image Source: https://www.analyticsvidhya.com/blog/2021/05/detecting-and-treating-outliers-treating-the-odd-one-out/ Detecting and Handling Outliers Detecting outliers — through visualization (box-plot — Using standard deviation — using Z-scores Handling outliers — Remove the outliers. — Quantile based capping and Flooring — Mean/Median imputation 12 Encoding Categorical variables Recap: Ordinal data, Nominal data Encoding methods — Label encoding — One-hot encoding — Effect encoding — Hash encoding — Binary encoding — Base N encoding — Target encoding 13 Encoding Categorical variables: Label Encoding Each label is converted into an integer value. Example: Consider the below data 14 Encoding Categorical variables: Label Encoding If we apply label encoding to ’safety’ feature, [’low’, ’med’, ’high’] will be encoded to [1, 2, 0]. Similarly for ’lug_boot’ feature, [’small’, ’med’, ’big’] will be encoded to [2, 1, 0]. 15 Encoding Categorical variables: One-hot Encoding It maps each category value with a binary value 0 or 1. If we apply label encoding to ’safety’ feature, 16 Terminology A feature vector is a numerical representation of an object ℝd Image Source: viswanathpulabaigari/course_work 17 Features and Samples Image Source: viswanathpulabaigari/course_work 18 Training, Validation, and Test sets Training set: is a set of examples used during the learning process and is used to fit or learn the parameters (e.g., weights) of a model, for example, a perceptron classifier. Validation set: is a set of examples used to tune the hyperparameters (i.e., the architecture) of a model. It is sometimes also called the development set or the ”dev set”. Test set: is a set of examples used only to assess the performance of a learned machine learning model. 19 Feature Engineering Feature engineering is the process that takes raw data and transforms it into features that can be used to create a predictive model using machine learning. Feature Transformation: is the process of transforming the features into a more suitable representation for the machine learning model. Feature Selection: is the process of selecting a subset of relevant features from the dataset to be used in a machine-learning model training. Consider a dataset having person details, height, weight, age, name, class(overweight or normal). For training a model to classify a given person is overweight or normal, person name is not significant. 20 Thank you 21