Professional Documents
Culture Documents
Process
Module 2 Objectives:
At the conclusion of this week, you should
be able to:
3) Data
6) Deployment
preparation
5) Evaluation 4) Modeling
Creating a Model
Past Observations Targets
Training
Model yi=f(Xi)+𝛆
Model yi=f(Xi)+𝛆
… … … … … …
How to Define Features
Algorithm
Selection
Computational
Accuracy
Efficiency
Netflix Example
https://netflixprize.com
Bias – Variance Tradeoff
Model Complexity
Model Complexity
Hyper-
Number of
Algorithm parameter
Features
Values
Bias and Variance
• Bias is error introduced by Low bias High bias
modeling a real life problem using a
simpler model that is unable to fully
capture the underlying patterns in
data
Low High
variance variance
• Variance refers to the sensitivity of
the model to small fluctuations in
the data, because it models fine
patterns which may just be noise
Target Predictions
Bias – Variance Tradeoff
• Simpler models often have
higher bias and lower
Total
variance Optimal error
model Variance
complexity
• Complex models typically have
lower bias but higher variance
Error
• Total Error = Bias ! + Var + σ!"
Bias2
Model complexity
Underfitting vs. Overfitting
Total
Optimal error
model Variance
complexity
Underfitting
Error
Model is too
simple
Bias2
Model complexity
Overfitting
Error
Model is too
complex
Bias2
Model complexity
K=5 Folds
Iteration 1 𝐸!
Val set
Iteration 2 𝐸"
Val set %
1
Iteration 3 Val set 𝐸# 𝐸 = & 𝐸&
5
&'!
Iteration 4
Val set 𝐸$
Iteration 5 Val set 𝐸%
Benefits of Cross Validation
• Maximizes the data available for
training the model – important for
small datasets
• Provides a better evaluation of how
well the model can generalize to new
data – validation performance is not
biased by choice of datapoints to use
for validation
Wrap-up
Wrap Up
• Modeling process is just one piece of the
CRISP-DM process
• Model complexity comes from features,
algorithm and hyperparameters
• Underfitting and overfitting are common
modeling issues
• Test sets and validation sets ensure we
properly select and evaluate models