Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Parameters vs. Hyperparameters | Introduction to Hyperparameter Tuning
Hyperparameter Tuning Basics

bookParameters vs. Hyperparameters

In machine learning, you will often hear the terms parameters and hyperparameters. Understanding the difference between these two is crucial for building, configuring, and improving models. Parameters are values that a model learns automatically from the training data; they define the internal state of the model after it has seen the data. Hyperparameters, on the other hand, are external settings that you choose before training begins; they control aspects of the learning process or the structure of the model itself. The distinction is important because while parameters are optimized automatically by the learning algorithm, hyperparameters must be set by you and can significantly influence the model's performance.

Note
Definition

Parameters are learned from data during training (for example, the weights in linear regression). Hyperparameters are set before training and control the learning process (such as the learning rate or the number of trees).

12345678910111213141516171819
from sklearn.linear_model import LogisticRegression from sklearn.datasets import load_iris # Load a simple dataset X, y = load_iris(return_X_y=True) # Create a LogisticRegression model with specific hyperparameters model = LogisticRegression(C=0.1, solver="liblinear") # C and solver are hyperparameters # Train the model (fit learns the parameters from data) model.fit(X, y) # Accessing learned parameters print("Model coefficients (parameters):\n", model.coef_) print("Model intercepts (parameters):", model.intercept_) # Accessing hyperparameters print("Hyperparameter C:", model.C) print("Hyperparameter solver:", model.solver)
copy
question mark

Which of the following is a hyperparameter in a scikit-learn model?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 1

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Suggested prompts:

Can you explain more about the difference between parameters and hyperparameters?

How do I choose good hyperparameters for my model?

What are some common hyperparameters in machine learning models?

Awesome!

Completion rate improved to 9.09

bookParameters vs. Hyperparameters

Swipe to show menu

In machine learning, you will often hear the terms parameters and hyperparameters. Understanding the difference between these two is crucial for building, configuring, and improving models. Parameters are values that a model learns automatically from the training data; they define the internal state of the model after it has seen the data. Hyperparameters, on the other hand, are external settings that you choose before training begins; they control aspects of the learning process or the structure of the model itself. The distinction is important because while parameters are optimized automatically by the learning algorithm, hyperparameters must be set by you and can significantly influence the model's performance.

Note
Definition

Parameters are learned from data during training (for example, the weights in linear regression). Hyperparameters are set before training and control the learning process (such as the learning rate or the number of trees).

12345678910111213141516171819
from sklearn.linear_model import LogisticRegression from sklearn.datasets import load_iris # Load a simple dataset X, y = load_iris(return_X_y=True) # Create a LogisticRegression model with specific hyperparameters model = LogisticRegression(C=0.1, solver="liblinear") # C and solver are hyperparameters # Train the model (fit learns the parameters from data) model.fit(X, y) # Accessing learned parameters print("Model coefficients (parameters):\n", model.coef_) print("Model intercepts (parameters):", model.intercept_) # Accessing hyperparameters print("Hyperparameter C:", model.C) print("Hyperparameter solver:", model.solver)
copy
question mark

Which of the following is a hyperparameter in a scikit-learn model?

Select the correct answer

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 1
some-alt