Professional Documents
Culture Documents
Machine Learning
S.Birundha,
Assistant Professor, CSE
1
5/18/2021
Machine Learning
a
Comprehensive
Overview
S.Birundha, AP/CSE
2
5/18/2021
AGENDA
● Discussion – Python IDE and Google Colab
● Python Libraries
● Machine Learning
Introduction to Sci-kit Learn
S.Birundha, AP/CSE
●
• https://colab.research.google.com/
S.Birundha, AP/CSE
5
Python Libraries
S.Birundha, AP/CSE
7
S.Birundha, AP/CSE 5/18/2021
8
S.Birundha, AP/CSE 5/18/2021
9
S.Birundha, AP/CSE 5/18/2021
10
S.Birundha, AP/CSE 5/18/2021
11
S.Birundha, AP/CSE 5/18/2021
12
S.Birundha, AP/CSE 5/18/2021
13
S.Birundha, AP/CSE 5/18/2021
14
S.Birundha, AP/CSE 5/18/2021
15
S.Birundha, AP/CSE 5/18/2021
16
S.Birundha, AP/CSE 5/18/2021
17
S.Birundha, AP/CSE 5/18/2021
18
Breakthroughs in AI
S.Birundha, AP/CSE
20
What the fun is
5/18/2021*
machine
learning?
S.Birundha, AP/CSE
21
Machine Learning
S.Birundha, AP/CSE
28
5/18/2021
Supervised Learning in ML
S.Birundha, AP/CSE
29
5/18/2021
Supervised Learning in ML
S.Birundha, AP/CSE
30
5/18/2021
Unsupervised Learning in ML
S.Birundha, AP/CSE
31
5/18/2021
Semi-Supervised Learning in ML
S.Birundha, AP/CSE
32
Reinforcement Learning in ML
5/18/2021
• Agent, learns by interacting with its environment.
S.Birundha, AP/CSE
33
5/18/2021*
Machine Learning 101
• Classifying a person as MALE or FEMALE
1. Male:
1. Weight > 75kg
1. Height
2. Height > 5’9’’
1. Weight
1. Female:
1. Weight < 70kg
2. Height < 5’7’’
S.Birundha, AP/CSE
1. Feature extraction: How to represent the data points ?
2. Classification: How to use the features to distinguish the classes ?
1. M: <h1, w1>
2. F: <h2, w2>
3. …
…
N. M: <hn, wn>
Data points h
Feature extraction Classification
S.Birundha, AP/CSE
1. Boundary: Can be linear or non-linear boundary
2. Method: Can be a generative classifier or discriminative classifier
Examples: Naïve Bayes, Decision trees, Neural Network, Support Vector Machines etc.
Classification is only as good as feature extraction !!!
35
5/18/2021*
Machine Learning - Pipeline
• Feature extraction
• Manual feature engineering – define what features to extract manually
• Unsupervised feature learning – learn the features automatically
• Deep learning is one way of unsupervised feature learning
S.Birundha, AP/CSE
• Learning
• Rule based learning – rules for classification are defined manually
• Machine Learning – learn the classification rules (boundary) automatically
36
ML Vs DL
5/18/2021
S.Birundha, AP/CSE
38
5/18/2021
Machine Learning Softwares
S.Birundha, AP/CSE
39
5/18/2021
Introduction to Sci-Kit Learn
• Scikit Learn is built on top of several common data and math Python
libraries.
• It uses the following libraries:
• NumPy: For any work with matrices, especially math operations
• SciPy: Scientific and technical computing
• Matplotlib: Data visualisation
• IPython: Interactive console for Python
S.Birundha, AP/CSE
• Sympy: Symbolic mathematics
• Pandas: Data handling, manipulation, and analysis
40
5/18/2021
Introduction to Sci-Kit Learn –
Contd…
• Scikit’s robust set of algorithm offerings includes:
• Regression: Fitting linear and non-linear models
• Clustering: Unsupervised classification
• Decision Trees: Tree induction and pruning for both classification
and regression tasks
• Neural Networks: End-to-end training for both classification and
regression. Layers can be easily defined in a tuple
S.Birundha, AP/CSE
• SVMs: for learning decision boundaries
• Naive Bayes: Direct probabilistic modelling
41
Scikit Learn
S.Birundha, AP/CSE
44
Example
• Linear Regression
• Logistic Regression
• Polynomial Regression
• Stepwise Regression
• Ridge Regression
• Lasso Regression
S.Birundha, AP/CSE
• ElasticNet Regression
46
5/18/2021
Problem Solving - Linear
Regression
• In this regression task,
• Predict the percentage of marks that a student is expected to score
based upon the number of hours they studied.
• This is a simple linear regression task as it involves just two variables.
S.Birundha, AP/CSE
• Where b is the intercept and m is the slope of the line.
47
Performance of an Alogorithm
5/18/2021
• Mean Absolute Error (MAE) is the mean of the absolute value of the
errors. It is calculated as:
• Mean Squared Error (MSE) is the mean of the squared errors and is
calculated as:
S.Birundha, AP/CSE
• Root Mean Squared Error (RMSE) is the square root of the mean of
the squared errors:
48
Open Discussion