3. Introduction to Machine Learning
3. Introduction to Machine Learning
Learning
What to expect from the course?
What is Machine Learning ?
Dimensionality Reduction
Hands-On session will be
Different Machine Learning Algorithms (Supervised, conducted in parallel
Unsupervised, metrics)
General Strategy: Given many examples of (X,Y), learn an automated solution to predict Y
Given a new X, Y = F(X)
3.1
There is too much information in raw data
-2.6
0.41
Relevant information is hidden probably? 1.89
3.9 m
₹ 8.2 L
15.2
Leads to Feature Extraction: Extracting Blue
useful information (X) from raw data
…
Sedan
9.23
Representation: From Raw data to Features
Area Bedrooms Bathrooms Age Parking Basement Price
240 3 2 10 No Yes 250000
𝐢 𝐢
Nominal Data - The categories are names or labels with no inherent order or ranking.
e.g.- Colors: Red, Green, Blue, Types of Pets: Dog, Cat, Bird, Fish.
Use Integer Encoding for ordinal data where the order of categories is meaningful.
Categories like "low," "medium," and "high" can be represented as 1, 2, and 3, respectively. The
numerical values reflect the order or ranking among the categories.
One-Hot Encoding is used for nominal data where there is no natural order, or to prevent
algorithms from mistakenly interpreting ordinal relationships between categories.
One-Hot Encoding
Most widespread approach used for categorical data, unless your categorical variable takes on a large
number of values.
Can lead to a significant increase in the number of features, especially if the categorical feature has
many unique values.
Representation: From Raw data to Features
Area Bedrooms Bathrooms Age Parking Basement Price
240 3 2 10 No Yes 250000
Our goal is to learn a model: that captures the pattern of the training
samples
We can assume a model and learn its parameters
Once we learn the model, we can predict the output, corresponding to any new
input, X’ :
Usual Programming vs Machine Learning
Programming: Machine Learning:
New Data: X’
Data Program Data: X Output: Y
F(X, Y)
Testing phase
Training phase
Computer
Computer Computer
Output: Y’
Output Program: F(X, Y)
ML Based on Training-Testing Data
Take care to not leak information from Test Data into the Model
Feature extraction, Goal: to predict f()
Training Data with the Building
Learn about f() from
representation of a model
training data
feature space
Model
Evaluation and Compute Prediction
Deployment for the test data
Data Representation
Age
Area Age Property
230 15 A
120 6 B
202 2 B
398 11 A
274 8 ?
Area
Feature Space Representation
Finding the best
Property Type Equation of the line
Feature extraction, fit line
with the Goal: to predict f()
Training Data Building
representation of Learn about f() from
a model
feature space training data
Unknown Property Type Area, Age as points in
Test Data 2D space Model Design
and Validation
Testing: apply f to the test example x’ and output the predicted value y = f(x’)
Summary – Machine Learning Framework
y = f(x)
output prediction feature or
function representation
1 2 3 4 5 6 7 8 Length
The weather is sunny today was rainy yesterday
1 1 1 1 1 1 0 0 0 5
2 1 1 0 0 0 1 1 1 5
Vector of Sentence 1: [1 1 1 1 1 0 0 0]
Vector of Sentence 2: [1 1 0 0 0 1 1 1]
Why sudden interest in AI?
Recommendation
Systems Virtual Assistants
Facial Recognition
E-Commerce
Create Photographs, Paintings
Chess/ Go Champions
Autonomous Cars/Navigation
Speech Recognition
Segmentation
Image Courtesy: Google
Other Applications
• Surveillance
• Automated Assembly
• Mail Sorting
• Face detection (photography)
• Robot Navigation
• Content-Based Image Retrieval
• Entertainment
• And many more…