Hyperparameter Tuning interview question

Machine LearningHyperparameter Tuningbasic

What is the difference between model parameters and hyperparameters?

  1. AParameters are set by the user before training; hyperparameters are learned from the data by the optimization algorithm.
  2. BParameters exist only in linear models; hyperparameters are the equivalent learned values inside neural networks.
  3. CParameters are the input features of the model; hyperparameters are the weights the model assigns to those features.
  4. DParameters are learned from the data during fitting; hyperparameters are set before training to configure the learner.
Show the answer and explanation

Correct answer: D, Parameters are learned from the data during fitting; hyperparameters are set before training to configure the learner.

Explanation Hyperparameter Tuning

Parameters are the values the learning algorithm estimates from the training data, such as the weights of a linear model or a neural network. Hyperparameters are chosen before training and are not learned by that fit: they configure the model or the learning process, e.g. learning rate, regularization strength λ, tree depth or number of layers.

ParametersHyperparameters
Set bythe training algorithmthe practitioner or a tuning search
Exampleregression coefficientslearning rate, λ

Why the other statements are wrong:

  • The roles are swapped: the user sets hyperparameters, the optimizer learns parameters.
  • Both linear models and neural networks have learned parameters (coefficients or weights) as well as hyperparameters.
  • Features are the model's inputs; the weights on those features are the learned parameters.

Interview tip: add that hyperparameters are tuned on a validation set or with cross-validation, not on the test set.

Practice it as a quiz

Answer this and the other free questions with instant grading, streaks and weak-topic tracking, or unlock all 4,000 questions.

More Machine Learning questions

  1. What does the bias–variance trade-off describe?
  2. What does the mean squared error cost J(w) = (1/n) Σ (yᵢ − ŷᵢ)² measure for a linear regression model?
  3. What does the Gini impurity of a decision-tree node measure?
  4. Which statement correctly contrasts bagging and boosting?
  5. What is the "naive" assumption in Naive Bayes?