Machine Learning
03
Computers are able to see, hear
and learn. Welcome to the
future.” ~Dave Waters
CONTENT OF THIS COURSE
Here’s what you’ll find in this Course :
● Machine Learning Workflow.
● Machine Learning Algorithms
● Machine Learning Techniques.
● Building Real world Projects.
Introduction to AI with ML
Machine Learning Workflow
Introduction to AI with ML
Machine Learning Workflow
Asking the
Right
Question
Preparing
data
Selecting
the
algorithm
Training the
model
Testing the
model
Introduction to AI with ML
Machine Learning Workflow
“I can’t make bricks without clay”.
-Arthur Conan Doyle
Introduction to AI with ML
Machine Learning Workflow
“A baby learns to crawl, walk and then run.
We are in the crawling stage when it comes to applying machine learning.”
-Dave Waters
Introduction to AI with ML
Machine Learning Workflow
Introduction to AI with ML
Introduction to AI with ML
Introduction to AI with ML
Data Gathering
Might depend on humanwork
• Manual labeling forsupervisedlearning.
• Domain knowledge.Maybe evenexperts.
May come forfree,or “sortof”
• E.g.,Machine Translation.
Themorethebetter:Some algorithmsneed large amounts of data tobe useful (e.g.,
neuralnetworks).
The quantity and quality of data dictatethe modelaccuracy
Introduction to AI with ML
Machine Learning Workflow
Asking the
Right
Question
Preparing
data
Selecting
the
algorithm
Training the
model
Testing the
model
Introduction to AI with ML
Introduction to AI with ML
Data Gathering
"Big Data is not about the Big data" -Gray king, Harvard University
making point that the data is plentiful ,but the real value is in analytics.
Introduction to AI with ML
Introduction to AI with ML
Data Preprocessing
Is there anything wrong with thedata?
• Missing values
• Outliers
• Bad encoding (fortext)
• Wrongly-labeled examples
• Biased data
• Do I have many more samples of one class than therest?
Need to fix/remove data?
Introduction to AI with ML
Data Preprocessing
What is missing data?
'In statistics, missing data, or missing values, occur when no
data value is stored for the variable in an observation. Missing
data are a common occurrence and can have a significant effect
on the conclusions that can be drawn from the data.'
Introduction to AI with ML
Data Preprocessing
Is there anything wrong with thedata?
• Missing values
• Outliers
• Bad encoding (fortext)
• Wrongly-labeled examples
• Biased data
• Do I have many more samples of one class than therest?
Need to fix/remove data?
Introduction to AI with ML
Machine Learning Workflow
Asking the
Right
Question
Preparing
data
Selecting
the
algorithm
Training the
model
Testing the
model
Introduction to AI with ML
Machine Learning Workflow
Testing the
model
Introduction to AI with ML
Select the algorithm
Introduction to AI with ML
Machine Learning Workflow
Asking the
Right
Question
Preparing
data
Selecting
the
algorithm
Training the
model
Testing the
model
Introduction to AI with ML
Train the Algorithm
Introduction to AI with ML
Select the algorithm
Introduction to AI with ML
Select the algorithm
Introduction to AI with ML
Select the algorithm
Introduction to AI with ML
Machine Learning Workflow
Asking the
Right
Question
Preparing
data
Selecting
the
algorithm
Training the
model
Testing the
model
Introduction to AI with ML
Test Score
Introduction to AI with ML
Test Score
Introduction to AI with ML
Test Score
Introduction to AI with ML
Test Score
Introduction to AI with ML
Test Score
Introduction to AI with ML
Machine Learning work Flow Guidelines
 Data is never as you need it
 More data is better.
 Expect to go backward
Introduction to AI with ML
Test Score
Introduction to AI with ML
SVM Algorithm
Introduction to AI with ML
SVM Algorithm
Introduction to AI with ML
SVM Algorithm
Tuning Parameters
SVM
1. Kernel
2. Regularization
3. Gamma
4. Margin
Introduction to AI with ML
Regularization
Also the ‘ C ‘ parameter in Python’s SkLearn Library
Optimises SVM classifier to avoid misclassifying the data.
C → large
C → small
Margin of hyperplane → small
Margin of hyperplane → large
misclassification(possible)
C ---> large , chance of overfit
C ---> small , chance of underfitting
Introduction to AI with ML
Overfitting vs Underfitting
Introduction to AI with ML
Overfitting vs Underfitting
Introduction to AI with ML
Overfitting vs Underfitting
Introduction to AI with ML
SVM Algorithm
Introduction to AI with ML
Margin
• Margin is the perpendicular distance between the closest data
points and the Hyperplane ( on both sides )
• The best optimised line ( hyperplane ) with maximum margin
is termed as Margin Maximal Hyper plane.
• The closest points where the margin distance is calculated are
considered as the support vectors.
Introduction to AI with ML
Gamma
Defines how far influences the calculation of of plausible line of
separation.
Low gamma -----> points far from plausible line are considered for
calculation
High gamma -----> points close to plausible line are considered for
calculation
High Gamma Value Low Gamma Value
Introduction to AI with ML
Kernel
Mathematical functions for transforming data
using some linear algebra
Different SVM algorithms use different types of kernel functions
1. Linear kernel
2. Non - linear kernel
3. Radial basis function ( RBF )
4. Sigmoid
5. Polynomial
6. Exponential
Introduction to AI with ML
Feature Scaling
Introduction to AI with ML
Feature Scaling
Introduction to AI with ML
Feature Scaling
 If features do not have the same numerical scale in values, will cause
issues in training a mode.
 If the scale of one independent variable (feature) is greater than another
independent variable, the model will give more importance (skew) to the
independent variable with the larger range.
 Toeliminate this problem, one converts all the independent
variables to use the same scale.
Normalization
Standardization ( -1 to 1 )

Part 3 Machine Learnning

  • 1.
    Machine Learning 03 Computers areable to see, hear and learn. Welcome to the future.” ~Dave Waters
  • 2.
    CONTENT OF THISCOURSE Here’s what you’ll find in this Course : ● Machine Learning Workflow. ● Machine Learning Algorithms ● Machine Learning Techniques. ● Building Real world Projects.
  • 3.
    Introduction to AIwith ML Machine Learning Workflow
  • 4.
    Introduction to AIwith ML Machine Learning Workflow Asking the Right Question Preparing data Selecting the algorithm Training the model Testing the model
  • 5.
    Introduction to AIwith ML Machine Learning Workflow “I can’t make bricks without clay”. -Arthur Conan Doyle
  • 6.
    Introduction to AIwith ML Machine Learning Workflow “A baby learns to crawl, walk and then run. We are in the crawling stage when it comes to applying machine learning.” -Dave Waters
  • 8.
    Introduction to AIwith ML Machine Learning Workflow
  • 9.
  • 10.
  • 11.
    Introduction to AIwith ML Data Gathering Might depend on humanwork • Manual labeling forsupervisedlearning. • Domain knowledge.Maybe evenexperts. May come forfree,or “sortof” • E.g.,Machine Translation. Themorethebetter:Some algorithmsneed large amounts of data tobe useful (e.g., neuralnetworks). The quantity and quality of data dictatethe modelaccuracy
  • 12.
    Introduction to AIwith ML Machine Learning Workflow Asking the Right Question Preparing data Selecting the algorithm Training the model Testing the model
  • 13.
  • 14.
    Introduction to AIwith ML Data Gathering "Big Data is not about the Big data" -Gray king, Harvard University making point that the data is plentiful ,but the real value is in analytics.
  • 15.
  • 16.
    Introduction to AIwith ML Data Preprocessing Is there anything wrong with thedata? • Missing values • Outliers • Bad encoding (fortext) • Wrongly-labeled examples • Biased data • Do I have many more samples of one class than therest? Need to fix/remove data?
  • 17.
    Introduction to AIwith ML Data Preprocessing What is missing data? 'In statistics, missing data, or missing values, occur when no data value is stored for the variable in an observation. Missing data are a common occurrence and can have a significant effect on the conclusions that can be drawn from the data.'
  • 18.
    Introduction to AIwith ML Data Preprocessing Is there anything wrong with thedata? • Missing values • Outliers • Bad encoding (fortext) • Wrongly-labeled examples • Biased data • Do I have many more samples of one class than therest? Need to fix/remove data?
  • 19.
    Introduction to AIwith ML Machine Learning Workflow Asking the Right Question Preparing data Selecting the algorithm Training the model Testing the model
  • 20.
    Introduction to AIwith ML Machine Learning Workflow Testing the model
  • 21.
    Introduction to AIwith ML Select the algorithm
  • 22.
    Introduction to AIwith ML Machine Learning Workflow Asking the Right Question Preparing data Selecting the algorithm Training the model Testing the model
  • 23.
    Introduction to AIwith ML Train the Algorithm
  • 25.
    Introduction to AIwith ML Select the algorithm
  • 26.
    Introduction to AIwith ML Select the algorithm
  • 27.
    Introduction to AIwith ML Select the algorithm
  • 28.
    Introduction to AIwith ML Machine Learning Workflow Asking the Right Question Preparing data Selecting the algorithm Training the model Testing the model
  • 29.
    Introduction to AIwith ML Test Score
  • 30.
    Introduction to AIwith ML Test Score
  • 31.
    Introduction to AIwith ML Test Score
  • 32.
    Introduction to AIwith ML Test Score
  • 33.
    Introduction to AIwith ML Test Score
  • 34.
    Introduction to AIwith ML Machine Learning work Flow Guidelines  Data is never as you need it  More data is better.  Expect to go backward
  • 35.
    Introduction to AIwith ML Test Score
  • 36.
    Introduction to AIwith ML SVM Algorithm
  • 37.
    Introduction to AIwith ML SVM Algorithm
  • 38.
    Introduction to AIwith ML SVM Algorithm Tuning Parameters SVM 1. Kernel 2. Regularization 3. Gamma 4. Margin
  • 39.
    Introduction to AIwith ML Regularization Also the ‘ C ‘ parameter in Python’s SkLearn Library Optimises SVM classifier to avoid misclassifying the data. C → large C → small Margin of hyperplane → small Margin of hyperplane → large misclassification(possible) C ---> large , chance of overfit C ---> small , chance of underfitting
  • 40.
    Introduction to AIwith ML Overfitting vs Underfitting
  • 41.
    Introduction to AIwith ML Overfitting vs Underfitting
  • 42.
    Introduction to AIwith ML Overfitting vs Underfitting
  • 43.
    Introduction to AIwith ML SVM Algorithm
  • 44.
    Introduction to AIwith ML Margin • Margin is the perpendicular distance between the closest data points and the Hyperplane ( on both sides ) • The best optimised line ( hyperplane ) with maximum margin is termed as Margin Maximal Hyper plane. • The closest points where the margin distance is calculated are considered as the support vectors.
  • 45.
    Introduction to AIwith ML Gamma Defines how far influences the calculation of of plausible line of separation. Low gamma -----> points far from plausible line are considered for calculation High gamma -----> points close to plausible line are considered for calculation High Gamma Value Low Gamma Value
  • 46.
    Introduction to AIwith ML Kernel Mathematical functions for transforming data using some linear algebra Different SVM algorithms use different types of kernel functions 1. Linear kernel 2. Non - linear kernel 3. Radial basis function ( RBF ) 4. Sigmoid 5. Polynomial 6. Exponential
  • 47.
    Introduction to AIwith ML Feature Scaling
  • 48.
    Introduction to AIwith ML Feature Scaling
  • 49.
    Introduction to AIwith ML Feature Scaling  If features do not have the same numerical scale in values, will cause issues in training a mode.  If the scale of one independent variable (feature) is greater than another independent variable, the model will give more importance (skew) to the independent variable with the larger range.  Toeliminate this problem, one converts all the independent variables to use the same scale. Normalization Standardization ( -1 to 1 )