18 min total

Machine Learning

Model evaluation

Model evaluation

Training performance is only part of the story. Validation, error analysis, and bias and variance help decide what to try next.

Training, validation, and test sets

Helps in selecting best model among different options

Helps in selecting best hyperparameters

Generalization error: Theoretical measure of how well ML model performs on unseen data

Test error: measure of how well a model performs on finite test set of data

Why a separate validation set matters

If you only have a training set and a test set, and you use the test set to choose the best model or hyperparameters, you end up indirectly overfitting to the test set.

This overfitting happens not in the training process, but in the model selection process. By selecting the model based on its performance on the test set, you effectively tailor your choice to the specifics of that set, leading to an inflated estimate of the model's performance.

Model selection

Train | Validation | Test

60% 20% 20%

Evaluating and improving a model — illustration

Gap between training and validation error gives degree of variance

Gap between generalization and training error gives degree of bias

Evaluating and improving a model — illustration
Evaluating and improving a model — illustration

Diagnosing bias and variance

MethodFixes
Try getting additional featuresHigh bias
Try adding polynomial featuresHigh bias
Try decreasing regularization constant λHigh bias
Try increasing regularization constant λHigh variance
Get more training examplesHigh variance
Try smaller sets of featuresHigh variance

Improving neural networks

Evaluating and improving a model — illustration
Evaluating and improving a model — illustration

You can make the networks bigger, but make sure that you apply regularization to prevent overfitting.

The NN on right can perform >= as NN on left if correct regularization is applied agr regularize nae kiya tou over fitting hojaegi.

The development loop and evaluation metrics

Evaluating and improving a model — illustration
Evaluating and improving a model — illustration

It's better to combine both precision and recall to form one score: F1 Score