ML 3170724 Unit-3
ML 3170724 Unit-3
Holdout method
K-fold cross-validation method
Bootstrap sampling
Lazy v/s Eager learners
Holdout
E.g. 3-fold CV
Lazy learning, on the other hand, completely skips the abstraction and
generalization processes
Lazy learner doesn’t ‘learn’ anything. It uses the training data in exact,
and uses the knowledge to classify the unlabelled test data.
Since lazy learning uses training data as-is, it is also known as rote
learning.
Due to its dependency on the given training data instance, it is also
known as instance learning.
Lazy learners take very little time in training because not much of
training actually happens. However, it takes more time in testing as for
each tuple of test data, a comparison-based assignment of label
happens.
E.g. KNN
Model Representation &
Interpretability
A key consideration in learning the target function from the training data
is the extent of generalization.
This is because the input data is just a limited, specific view and the new,
unknown data in the test data set may be differing from the training data.
Underfitting: If the target function is kept too simple, it may not be able to
capture the essential nuances and represent the underlying data well.
Underfitting results in both poor performance with training data as well as
poor generalization to test data.
Underfitting can be avoided by
using more training data
reducing features by effective feature selection
Model Representation &
Interpretability
Overfitting: refers to a situation where the model has been
designed in such a way that it emulates the training data too
closely.
Any specific deviation in the training data, like noise or
outliers, get embedded in the model.
It adversely impacts the model performance on the test data.
Overfitting results in good performance with training data set,
but poor generalization with test data set.
Overfitting can be avoided by
using re-sampling techniques like k-fold cross validation
hold back of a validation data set
Model Representation &
Interpretability
Model Representation &
Interpretability
Errors in learning can be due to ‘bias’ and due to
‘variance’
Bias: Errors due to bias arise from simplifying
assumptions made by the model to make the target
function less complex or easier to learn. Underfitting
results in high bias.
Variance: Errors due to variance occur from difference in
training data sets used to train the model.
Ideally, the difference in the data sets should not be
significant and the model trained using different training
data sets should not be too different. However, in case of
overfitting, since the model closely matches the training
Model Representation &
Interpretability
Evaluating Model Performance
FOR CLASSIFICATION
There are four possibilities for cricket match win/loss
prediction:
1. the model predicted win and the team won
2. the model predicted win and the team lost
3. the model predicted loss and the team won
4. the model predicted loss and the team lost
The first case is where the model has correctly classified data
instances as the class of interest. True Positive (TP)
cases.
The second case is where the model incorrectly classified data
instances as the class of interest. False Positive (FP)
Confusion Matrix
Evaluating
Model
Performan
ce
Evaluating Model Performance
The area under curve (AUC) value is the area of the two-dimensional
space under the curve from (0, 0) to (1, 1), where each point on the
curve gives a set of TP and FP values at a specific classification
threshold.
AUC value ranges from 0 to 1, with an AUC of less than 0.5 indicating
that the classifier has no predictive ability.
Evaluating Model Performance
Data:
Evaluating Model
FORPerformance
PREDICTION
A regression model which
ensures that the difference
between predicted and
actual values is low can be
considered as a good model.
The distance between the
actual value and the fitted
or predicted value, i.e. ŷ is
known as residual.
The regression model can
be considered to be fitted
well if the difference
between actual and
predicted value, i.e. the
residual value is less.
Evaluating Model Performance
For a data set clustered into ‘k’ clusters, silhouette width is calculated
as:
Evaluating Model Performance
FOR CLUSTURING
1. Internal evaluation
The internal evaluation methods generally measure cluster quality based
on homogeneity of data belonging to the same cluster and heterogeneity
of data belonging to different clusters. The homogeneity/heterogeneity is
decided by some similarity measure.
silhouette coefficient, which is one of the most popular internal evaluation
methods, uses distance (Euclidean or Manhattan distances most
commonly used) between data elements as a similarity measure. The
value of silhouette width ranges between –1 and +1, with a high value
indicating high intracluster homogeneity and inter-cluster heterogeneity
Evaluating Model Performance
2. External evaluation
In this approach, class label is known for the data set subjected to
clustering. However, quite obviously, the known class labels are not a part
of the data used in clustering. The cluster algorithm is assessed based on
how close the results are compared to those known class labels.
Purity is one of the most popular measures of cluster algorithms –
evaluates the extent to which clusters contain a single class
For a data set having ‘n’ data instances and ‘c’ known class labels which
generates ‘k’ clusters, purity is measured as:
Improving Model Performance
Thanks
Unit no : 3
Modelling and
Evaluation
(3170724)