SlideShare a Scribd company logo
3
Most read
5
Most read
21
Most read
Modelling and Evaluation
Prakash G Khaire
The Mandvi Education Society Institute
of Computer Studies
Introduction
• Structured representation of raw input data to the
meaningful pattern is called a model.
• The decision regarding which model is to be selected
for a specific data set is taken by the learning task,
based on the problem to be solved and type of data.
– Example : When the problem is related to prediction and the target
field is numeric and continuous, the regression model is assigned.
• The process of assigning a model, and fitting a specific
model to a data set is called model training.
Selecting a Model
• Machine Learning is an optimization problem.
• We try to define a model and tune the
parameters to find the most suitable solution
to a problem.
• We need to have a way to evaluate the quality
or optimality of a solution, using “Objective
Function”
Selecting a Model
Predictive Model
• Model that helps to define certain value using
the values in an input data set.
• The learning model attempts to establish a
relation between the target feature.
• The predictive models have a clear focus on
what they want to learn and how they want to
learn.
Predictive Model
• Examples of Predictive Model
– Win/Loss in a cricket match.
– Whether a transaction is fraud.
– Whether a customer may move to another
product.
Predictive Model
• The models which are used for prediction of
target features of categorical value are known
as classification models.
• Popular classification model are k-Nearest
Neighbour (kNN), Naïve Bayes, and Decision
Tree
Predictive Model
• Predictive Models may also be used to predict numerical
values of the target feature based on the predictor features.
– Prediction of revenue growth in the succeeding year
– Prediction of rainfall amount in coming monsoon
– Prediction of potential flu patients and demand for flu
shots next winter
• The Model used for prediction of numerical value of the
target feature of data instance are known as regression model
– Popular regression models are Linear Regression and
Logistic Regression models
Descriptive Models
• Models used to describe a data set or gain insight
from a data set is called unsupervised learning or
descriptive model.
• No target feature or single feature of interest in
case of unsupervised learning.
• Based on the value of all features, interesting
patterns or insights are derived about the data
set.
Descriptive Models
• Descriptive models which group together similar data
instances, i.e. data instances having a similar value of
the different features are called clustering models.
• Examples of clustering include
– Customer grouping or segmentation based on social,
demographic, ethnic, etc factors.
– Grouping of music based on different aspects like genre,
language, time-period, etc.
– Grouping of commodities in an inventory
• The most popular model fro clustering is k-Means
Training a Model
(For supervised learning)
K-fold Cross Validataion
• K-Fold CV is where a given data set is split into a K number
of sections/folds where each fold is used as a testing set at
some point.
• Lets take the scenario of 5-Fold cross validation(K=5). Here,
the data set is split into 5 folds.
• In the first iteration, the first fold is used to test the model
and the rest are used to train the model.
• In the second iteration, 2nd fold is used as the testing set
while the rest serve as the training set. This process is
repeated until each fold of the 5 folds have been used as
the testing set.
K-fold Cross Validation
K-fold Cross Validation
• The value of ‘k’ in k-fold cross-validation can be
set to any number. There are two approaches
which are extremely popular.
– 10 fold cross-validation (10 fold CV)
• One of the folds is used as the test data for validating model
performance trained based on the remaining 9 folds.
– Leave-one-out Cross Validation (LOOCV)
• Using one record or data instance at a time as a test data.
Bootstrap sampling
• It is a popular way to identify training and test
data sets from the input data sets.
• It uses the technique of Simple Random Sampling
with Replacement, which is well known
technique in sampling theory for drawing random
samples.
• This technique is particularly useful in case of
input data sets of small size, i.e. having very less
number of data instances.
Model Representation and
Interpretability
• The goal of supervised machine learning is to
learn or derive a target function which can
best determine the target variable from the
set of input variables.
• Fitness of a target function approximated by a
learning algorithm determines how correctly it
is able to classify a set of data it has never
seen.
Underfitting
• A statistical model or a machine learning algorithm is said to have
underfitting when it cannot capture the underlying trend of the data. (It’s
just like trying to fit undersized pants!)
• Underfitting destroys the accuracy of our machine learning model.
• Its occurrence simply means that our model or the algorithm does not fit
the data well enough.
• It usually happens when we have less data to build an accurate model and
also when we try to build a linear model with a non-linear data.
• In such cases the rules of the machine learning model are too easy and
flexible to be applied on such a minimal data and therefore the model will
probably make a lot of wrong predictions.
• Underfitting can be avoided by using more training data and also reducing
the features by effective feature selection.
Underfitting
Overfitting
• A statistical model is said to be overfitted, when we train it with a lot of
data (just like fitting ourselves in an oversized pants!).
• When a model gets trained with so much of data, it starts learning from
the noise and inaccurate data entries in our data set.
• Then the model does not categorize the data correctly, because of too
much of details and noise.
• The causes of overfitting are the non-parametric and non-linear methods
because these types of machine learning algorithms have more freedom
in building the model based on the dataset and therefore they can really
build unrealistic models.
• A solution to avoid overfitting is using re-sampling techniques like k-fold
cross validataion, hold back of a validation data set, remove the nodes
which have little or no predictive power for the given machine learning
problem.
Bias – Variance trade off
• In supervised learning, the class value
assigned by the learning model built based on
the training data may differ from the actual
class value.
• This error in learning can be of two types –
errors due to ‘bias’ and error due to ‘variance’.
Errors due to ‘Bias’
• The error due to bias is taken as the difference between the
expected (or average) prediction of our model and the correct value
which we are trying to predict.
• Of course you only have one model so talking about expected or
average prediction values might seem a little strange.
• However, imagine you could repeat the whole model building
process more than once: each time you gather new data and run a
new analysis creating a new model.
• Due to randomness in the underlying data sets, the resulting
models will have a range of predictions.
• Bias measures how far off in general these models' predictions are
from the correct value.
Errors due to ‘Variance’
• The error due to variance is taken as the
variability of a model prediction for a given data
point.
• Again, imagine you can repeat the entire model
building process multiple times.
• The variance is how much the predictions for a
given point vary between different realizations of
the model.
Bias – Variance trade off
• The problem in training a model can either
happen because
– The model is too simple and hence fails to interpret
the data grossly
– The model is extremely complex and magnifies even
small differences in the training data
• Bias – Variance trade off learning
– Increasing the bias will decrease the variance
– Increasing the variance will decrease the bias
Supervised Learning - Classification

More Related Content

PPTX
Model Performance Metrics. Accuracy, Precision, Recall
PDF
An Introduction to Supervised Machine Learning and Pattern Classification: Th...
PDF
L2. Evaluating Machine Learning Algorithms I
PDF
Unsupervised Learning in Machine Learning
PPTX
Machine Learning Unit 1 Semester 3 MSc IT Part 2 Mumbai University
PDF
Introduction to Statistical Machine Learning
PPTX
Over fitting underfitting
PDF
Module 4: Model Selection and Evaluation
Model Performance Metrics. Accuracy, Precision, Recall
An Introduction to Supervised Machine Learning and Pattern Classification: Th...
L2. Evaluating Machine Learning Algorithms I
Unsupervised Learning in Machine Learning
Machine Learning Unit 1 Semester 3 MSc IT Part 2 Mumbai University
Introduction to Statistical Machine Learning
Over fitting underfitting
Module 4: Model Selection and Evaluation

What's hot (20)

PPTX
Data preprocessing in Machine learning
PPTX
Association rule mining.pptx
PDF
Feature Engineering in Machine Learning
PPTX
Classification in data mining
PPTX
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
PDF
Performance Metrics for Machine Learning Algorithms
PPTX
Machine learning and types
PPT
2.4 rule based classification
PPTX
Data preprocessing
PDF
An introduction to Machine Learning
PDF
Classification in Data Mining
PDF
Data preprocessing using Machine Learning
PDF
K - Nearest neighbor ( KNN )
PPTX
Unsupervised learning clustering
PPT
2.3 bayesian classification
PPTX
Classification and Regression
PPTX
Supervised and unsupervised learning
PPTX
10 -- Overfitting and Underfitting.pptx
PPTX
K-Folds Cross Validation Method
PPT
3.3 hierarchical methods
Data preprocessing in Machine learning
Association rule mining.pptx
Feature Engineering in Machine Learning
Classification in data mining
Supervised and Unsupervised Learning In Machine Learning | Machine Learning T...
Performance Metrics for Machine Learning Algorithms
Machine learning and types
2.4 rule based classification
Data preprocessing
An introduction to Machine Learning
Classification in Data Mining
Data preprocessing using Machine Learning
K - Nearest neighbor ( KNN )
Unsupervised learning clustering
2.3 bayesian classification
Classification and Regression
Supervised and unsupervised learning
10 -- Overfitting and Underfitting.pptx
K-Folds Cross Validation Method
3.3 hierarchical methods
Ad

Similar to Modelling and evaluation (20)

PPT
5_Model for Predictions_Machine_Learning.ppt
PPTX
UNIT-II-Machine-Learning.pptx Machine Learning Different AI Models
PPTX
Unit-3 ML Modelling and Evaluation .pptx
PPTX
ML2_ML (1) concepts explained in details.pptx
PPTX
PPTX
MACHINE LEARNING YEAR DL SECOND PART.pptx
PPTX
Intro of Machine Learning Models .pptx
PPTX
Overfitting & Underfitting
PDF
ML MODULE 5.pdf
PPTX
machine learning types methods classification regression decision tree
PPTX
Statistical Learning and Model Selection module 2.pptx
PDF
Introduction to machine learning
PPTX
regression.pptx
PPTX
Statistical Learning and Model Selection (1).pptx
PPTX
Model_Representation___Presentation.pptx
PDF
Machine Learning - Deep Learning
PDF
Machine Learning Model Evaluation Methods
PPTX
Machine learning with scikitlearn
PPTX
Lecture 4b _Overfitting_Underfitting_Bias_Variance_Presentation.pptx
PPTX
Doctor, Ismail ishengoma PowerPointL3.pptx
5_Model for Predictions_Machine_Learning.ppt
UNIT-II-Machine-Learning.pptx Machine Learning Different AI Models
Unit-3 ML Modelling and Evaluation .pptx
ML2_ML (1) concepts explained in details.pptx
MACHINE LEARNING YEAR DL SECOND PART.pptx
Intro of Machine Learning Models .pptx
Overfitting & Underfitting
ML MODULE 5.pdf
machine learning types methods classification regression decision tree
Statistical Learning and Model Selection module 2.pptx
Introduction to machine learning
regression.pptx
Statistical Learning and Model Selection (1).pptx
Model_Representation___Presentation.pptx
Machine Learning - Deep Learning
Machine Learning Model Evaluation Methods
Machine learning with scikitlearn
Lecture 4b _Overfitting_Underfitting_Bias_Variance_Presentation.pptx
Doctor, Ismail ishengoma PowerPointL3.pptx
Ad

More from eShikshak (20)

PDF
Operators in python
PDF
Datatypes in python
PDF
Introduction to python
PPT
Introduction to e commerce
PDF
Chapeter 2 introduction to cloud computing
PDF
Unit 1.4 working of cloud computing
PDF
Unit 1.3 types of cloud
PDF
Unit 1.2 move to cloud computing
PDF
Unit 1.1 introduction to cloud computing
PPT
Mesics lecture files in 'c'
PPT
Mesics lecture 8 arrays in 'c'
PPT
Mesics lecture 7 iteration and repetitive executions
PPT
Mesics lecture 5 input – output in ‘c’
PPT
Mesics lecture 6 control statement = if -else if__else
PPT
Mesics lecture 4 c operators and experssions
PPT
Mesics lecture 5 input – output in ‘c’
PPT
Mesics lecture 3 c – constants and variables
PDF
Lecture 7 relational_and_logical_operators
PDF
Lecture21 categoriesof userdefinedfunctions.ppt
PDF
Lecture20 user definedfunctions.ppt
Operators in python
Datatypes in python
Introduction to python
Introduction to e commerce
Chapeter 2 introduction to cloud computing
Unit 1.4 working of cloud computing
Unit 1.3 types of cloud
Unit 1.2 move to cloud computing
Unit 1.1 introduction to cloud computing
Mesics lecture files in 'c'
Mesics lecture 8 arrays in 'c'
Mesics lecture 7 iteration and repetitive executions
Mesics lecture 5 input – output in ‘c’
Mesics lecture 6 control statement = if -else if__else
Mesics lecture 4 c operators and experssions
Mesics lecture 5 input – output in ‘c’
Mesics lecture 3 c – constants and variables
Lecture 7 relational_and_logical_operators
Lecture21 categoriesof userdefinedfunctions.ppt
Lecture20 user definedfunctions.ppt

Recently uploaded (20)

PDF
Foundation of Data Science unit number two notes
PDF
Lecture1 pattern recognition............
PPTX
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
PPTX
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
PPTX
Introduction to Knowledge Engineering Part 1
PPTX
05. PRACTICAL GUIDE TO MICROSOFT EXCEL.pptx
PPTX
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
PPTX
Database Infoormation System (DBIS).pptx
PDF
Fluorescence-microscope_Botany_detailed content
PPTX
Data_Analytics_and_PowerBI_Presentation.pptx
PPTX
Global journeys: estimating international migration
PPTX
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
PDF
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
PPTX
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
PPT
Reliability_Chapter_ presentation 1221.5784
PPTX
Business Ppt On Nestle.pptx huunnnhhgfvu
PDF
Introduction to Business Data Analytics.
PDF
Clinical guidelines as a resource for EBP(1).pdf
PPTX
Moving the Public Sector (Government) to a Digital Adoption
PPTX
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...
Foundation of Data Science unit number two notes
Lecture1 pattern recognition............
advance b rammar.pptxfdgdfgdfsgdfgsdgfdfgdfgsdfgdfgdfg
mbdjdhjjodule 5-1 rhfhhfjtjjhafbrhfnfbbfnb
Introduction to Knowledge Engineering Part 1
05. PRACTICAL GUIDE TO MICROSOFT EXCEL.pptx
The THESIS FINAL-DEFENSE-PRESENTATION.pptx
Database Infoormation System (DBIS).pptx
Fluorescence-microscope_Botany_detailed content
Data_Analytics_and_PowerBI_Presentation.pptx
Global journeys: estimating international migration
Introduction to Firewall Analytics - Interfirewall and Transfirewall.pptx
168300704-gasification-ppt.pdfhghhhsjsjhsuxush
iec ppt-1 pptx icmr ppt on rehabilitation.pptx
Reliability_Chapter_ presentation 1221.5784
Business Ppt On Nestle.pptx huunnnhhgfvu
Introduction to Business Data Analytics.
Clinical guidelines as a resource for EBP(1).pdf
Moving the Public Sector (Government) to a Digital Adoption
Introduction to Basics of Ethical Hacking and Penetration Testing -Unit No. 1...

Modelling and evaluation

  • 1. Modelling and Evaluation Prakash G Khaire The Mandvi Education Society Institute of Computer Studies
  • 2. Introduction • Structured representation of raw input data to the meaningful pattern is called a model. • The decision regarding which model is to be selected for a specific data set is taken by the learning task, based on the problem to be solved and type of data. – Example : When the problem is related to prediction and the target field is numeric and continuous, the regression model is assigned. • The process of assigning a model, and fitting a specific model to a data set is called model training.
  • 3. Selecting a Model • Machine Learning is an optimization problem. • We try to define a model and tune the parameters to find the most suitable solution to a problem. • We need to have a way to evaluate the quality or optimality of a solution, using “Objective Function”
  • 5. Predictive Model • Model that helps to define certain value using the values in an input data set. • The learning model attempts to establish a relation between the target feature. • The predictive models have a clear focus on what they want to learn and how they want to learn.
  • 6. Predictive Model • Examples of Predictive Model – Win/Loss in a cricket match. – Whether a transaction is fraud. – Whether a customer may move to another product.
  • 7. Predictive Model • The models which are used for prediction of target features of categorical value are known as classification models. • Popular classification model are k-Nearest Neighbour (kNN), Naïve Bayes, and Decision Tree
  • 8. Predictive Model • Predictive Models may also be used to predict numerical values of the target feature based on the predictor features. – Prediction of revenue growth in the succeeding year – Prediction of rainfall amount in coming monsoon – Prediction of potential flu patients and demand for flu shots next winter • The Model used for prediction of numerical value of the target feature of data instance are known as regression model – Popular regression models are Linear Regression and Logistic Regression models
  • 9. Descriptive Models • Models used to describe a data set or gain insight from a data set is called unsupervised learning or descriptive model. • No target feature or single feature of interest in case of unsupervised learning. • Based on the value of all features, interesting patterns or insights are derived about the data set.
  • 10. Descriptive Models • Descriptive models which group together similar data instances, i.e. data instances having a similar value of the different features are called clustering models. • Examples of clustering include – Customer grouping or segmentation based on social, demographic, ethnic, etc factors. – Grouping of music based on different aspects like genre, language, time-period, etc. – Grouping of commodities in an inventory • The most popular model fro clustering is k-Means
  • 11. Training a Model (For supervised learning)
  • 12. K-fold Cross Validataion • K-Fold CV is where a given data set is split into a K number of sections/folds where each fold is used as a testing set at some point. • Lets take the scenario of 5-Fold cross validation(K=5). Here, the data set is split into 5 folds. • In the first iteration, the first fold is used to test the model and the rest are used to train the model. • In the second iteration, 2nd fold is used as the testing set while the rest serve as the training set. This process is repeated until each fold of the 5 folds have been used as the testing set.
  • 14. K-fold Cross Validation • The value of ‘k’ in k-fold cross-validation can be set to any number. There are two approaches which are extremely popular. – 10 fold cross-validation (10 fold CV) • One of the folds is used as the test data for validating model performance trained based on the remaining 9 folds. – Leave-one-out Cross Validation (LOOCV) • Using one record or data instance at a time as a test data.
  • 15. Bootstrap sampling • It is a popular way to identify training and test data sets from the input data sets. • It uses the technique of Simple Random Sampling with Replacement, which is well known technique in sampling theory for drawing random samples. • This technique is particularly useful in case of input data sets of small size, i.e. having very less number of data instances.
  • 16. Model Representation and Interpretability • The goal of supervised machine learning is to learn or derive a target function which can best determine the target variable from the set of input variables. • Fitness of a target function approximated by a learning algorithm determines how correctly it is able to classify a set of data it has never seen.
  • 17. Underfitting • A statistical model or a machine learning algorithm is said to have underfitting when it cannot capture the underlying trend of the data. (It’s just like trying to fit undersized pants!) • Underfitting destroys the accuracy of our machine learning model. • Its occurrence simply means that our model or the algorithm does not fit the data well enough. • It usually happens when we have less data to build an accurate model and also when we try to build a linear model with a non-linear data. • In such cases the rules of the machine learning model are too easy and flexible to be applied on such a minimal data and therefore the model will probably make a lot of wrong predictions. • Underfitting can be avoided by using more training data and also reducing the features by effective feature selection.
  • 19. Overfitting • A statistical model is said to be overfitted, when we train it with a lot of data (just like fitting ourselves in an oversized pants!). • When a model gets trained with so much of data, it starts learning from the noise and inaccurate data entries in our data set. • Then the model does not categorize the data correctly, because of too much of details and noise. • The causes of overfitting are the non-parametric and non-linear methods because these types of machine learning algorithms have more freedom in building the model based on the dataset and therefore they can really build unrealistic models. • A solution to avoid overfitting is using re-sampling techniques like k-fold cross validataion, hold back of a validation data set, remove the nodes which have little or no predictive power for the given machine learning problem.
  • 20. Bias – Variance trade off • In supervised learning, the class value assigned by the learning model built based on the training data may differ from the actual class value. • This error in learning can be of two types – errors due to ‘bias’ and error due to ‘variance’.
  • 21. Errors due to ‘Bias’ • The error due to bias is taken as the difference between the expected (or average) prediction of our model and the correct value which we are trying to predict. • Of course you only have one model so talking about expected or average prediction values might seem a little strange. • However, imagine you could repeat the whole model building process more than once: each time you gather new data and run a new analysis creating a new model. • Due to randomness in the underlying data sets, the resulting models will have a range of predictions. • Bias measures how far off in general these models' predictions are from the correct value.
  • 22. Errors due to ‘Variance’ • The error due to variance is taken as the variability of a model prediction for a given data point. • Again, imagine you can repeat the entire model building process multiple times. • The variance is how much the predictions for a given point vary between different realizations of the model.
  • 23. Bias – Variance trade off • The problem in training a model can either happen because – The model is too simple and hence fails to interpret the data grossly – The model is extremely complex and magnifies even small differences in the training data • Bias – Variance trade off learning – Increasing the bias will decrease the variance – Increasing the variance will decrease the bias
  • 24. Supervised Learning - Classification