It can be confusing when you get started in applied machine learning.
There are so many terms to use and many of the terms may not be used consistently. This is especially true if you have come from another field of study that may use some of the same terms as machine learning, but they are used differently.
For example: the terms “model parameter” and “model hyperparameter”.
Not having a clear definition for these terms is a common struggle for beginners, especially those that have come from the fields of statistics or economics.
In this post, we will take a closer look at these terms.
First, let’s take a look at what make you confused: ”parameter”
A model parameter is a configuration variable that is internal to the model and whose value can be estimated from data.
Parameters are key to machine learning algorithms. They are the part of the model that is learned from historical training data.
In classical machine learning literature, we may think of the model as the hypothesis and the parameters as the tailoring of the hypothesis to a specific set of data.
Often model parameters are estimated using an optimization algorithm, which is a type of efficient search through possible parameter values.
Whether a model has a fixed or variable number of parameters determines whether it may be referred to as “parametric” or “nonparametric“.
Some examples of model parameters include:
A model hyperparameter is a configuration that is external to the model and whose value cannot be estimated from data.
We cannot know the best value for a model hyperparameter on a given problem. We may use rules of thumb, copy values used on other problems, or search for the best value by trial and error.
When a machine learning algorithm is tuned for a specific problem, such as when you are using a grid search or a random search, then you are tuning the hyperparameters of the model or order to discover the parameters of the model that result in the most skillful predictions.
Many models have important parameters which cannot be directly estimated from the data. For example, in the K-nearest neighbor classification model … This type of model parameter is referred to as a tuning parameter because there is no analytical formula available to calculate an appropriate value.
— Page 64-65, Applied Predictive Modeling, 2013
Model hyperparameters are often referred to as model parameters which can make things confusing. A good rule of thumb to overcome this confusion is as follows:
If you have to specify a model parameter manually then it is probably a model hyperparameter.
Some examples of model hyperparameters include:
In this post, you discovered the clear definitions and the difference between model parameters and model hyperparameters.
In summary, model parameters are estimated from data automatically and model hyperparameters are set manually and are used in processes to help estimate model parameters.
Model hyperparameters are often referred to as parameters because they are the parts of the machine learning that must be set manually and tuned.