Parameters are the values the model learns from the data during training.
For example, in a simple model y = mx + c where
The slope m tells us how much the predicted output changes when the input increases by one unit.
A positive slope means y increases as x increases, while a negative slope means y decreases.
The intercept b represents the predicted value of y when x = 0
It shows where the line crosses the y-axis and provides a baseline prediction.
These parameters are learned automatically during training by fitting the model to the data, rather than being set manually by the programmer.
While parameters like the slope and intercept are learned from the data, some values must be chosen before training begins.
These are called hyperparameters.
You have already encountered hyperparameters in other models:
These choices are made before training the model begins and can strongly influence how the model learns and how complex the final model becomes.
Play with the KNN simulator. For any dataset, is there a situation where the prediction differs for different values of K?
This would be a indication that setting the value of a hyperparameter such as K can impact the accuracy of prediction that the model makes.
And so hyperparameter tuning is conducted to get optimal values for hyperparameters before training begins.
Hyperparameters are model parameters set before training. They influence how accurate the model's predictions will be.
An example of a hyperparameter is the depth of a decision tree.
A tree that is too deep will not generalise well - it will overfit.
A decision tree that is too shallow has insufficient depth to capture the patterns in the data. As a result, it makes overly simple decisions based on only a small number of features or splits.
This is known as underfitting.
By tuning hyperparameters such as tree depth before training, the model's performance can be optimised.
Machine Learning
Supervised Learning
Unsupervised Learning
Labels
Training
Training data
Test data
Features
Machine Learninglabels Supervised learning Unsupervised learning features model training data trainingtest data