• About
  • Advertise
  • Privacy & Policy
  • Contact
Thursday, January 1, 2026
  • Login
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
    • Home – Layout 4
    • Home – Layout 5
    • Home – Layout 6
  • News
    • All
    • Business
    • Politics
    • Science
    • World
    Hillary Clinton in white pantsuit for Trump inauguration

    Hillary Clinton in white pantsuit for Trump inauguration

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Tech
    • All
    • Apps
    • Gadget
    • Mobile
    • Startup
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Entertainment
    • All
    • Gaming
    • Movie
    • Music
    • Sports
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    So you want to be a startup investor? Here are things you should know

    So you want to be a startup investor? Here are things you should know

  • Lifestyle
    • All
    • Fashion
    • Food
    • Health
    • Travel
    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    How couples can solve lighting disagreements for good

    How couples can solve lighting disagreements for good

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • Review
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    Intel Core i7-7700K ‘Kaby Lake’ review

    Intel Core i7-7700K ‘Kaby Lake’ review

No Result
View All Result
Ai News
Advertisement
  • Home
    • Home – Layout 1
    • Home – Layout 2
    • Home – Layout 3
    • Home – Layout 4
    • Home – Layout 5
    • Home – Layout 6
  • News
    • All
    • Business
    • Politics
    • Science
    • World
    Hillary Clinton in white pantsuit for Trump inauguration

    Hillary Clinton in white pantsuit for Trump inauguration

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Amazon has 143 billion reasons to keep adding more perks to Prime

    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    Trending Tags

    • Trump Inauguration
    • United Stated
    • White House
    • Market Stories
    • Election Results
  • Tech
    • All
    • Apps
    • Gadget
    • Mobile
    • Startup
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    These Are the 5 Big Tech Stories to Watch in 2017

    These Are the 5 Big Tech Stories to Watch in 2017

    Trending Tags

    • Nintendo Switch
    • CES 2017
    • Playstation 4 Pro
    • Mark Zuckerberg
  • Entertainment
    • All
    • Gaming
    • Movie
    • Music
    • Sports
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    Harnessing the power of VR with Power Rangers and Snapdragon 835

    So you want to be a startup investor? Here are things you should know

    So you want to be a startup investor? Here are things you should know

  • Lifestyle
    • All
    • Fashion
    • Food
    • Health
    • Travel
    Shooting More than 40 Years of New York’s Halloween Parade

    Shooting More than 40 Years of New York’s Halloween Parade

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Heroes of the Storm Global Championship 2017 starts tomorrow, here’s what you need to know

    Why Millennials Need to Save Twice as Much as Boomers Did

    Why Millennials Need to Save Twice as Much as Boomers Did

    Doctors take inspiration from online dating to build organ transplant AI

    Doctors take inspiration from online dating to build organ transplant AI

    How couples can solve lighting disagreements for good

    How couples can solve lighting disagreements for good

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Ducati launch: Lorenzo and Dovizioso’s Desmosedici

    Trending Tags

    • Golden Globes
    • Game of Thrones
    • MotoGP 2017
    • eSports
    • Fashion Week
  • Review
    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    The Legend of Zelda: Breath of the Wild gameplay on the Nintendo Switch

    Shadow Tactics: Blades of the Shogun Review

    Shadow Tactics: Blades of the Shogun Review

    macOS Sierra review: Mac users get a modest update this year

    macOS Sierra review: Mac users get a modest update this year

    Hands on: Samsung Galaxy A5 2017 review

    Hands on: Samsung Galaxy A5 2017 review

    The Last Guardian Playstation 4 Game review

    The Last Guardian Playstation 4 Game review

    Intel Core i7-7700K ‘Kaby Lake’ review

    Intel Core i7-7700K ‘Kaby Lake’ review

No Result
View All Result
Ai News
No Result
View All Result
Home Machine Learning

Three Essential Hyperparameter Tuning Techniques for Better Machine Learning Models

AiNEWS2025 by AiNEWS2025
2025-08-24
in Machine Learning
0
Three Essential Hyperparameter Tuning Techniques for Better Machine Learning Models
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter


Learning (ML) model should not memorize the training data. Instead, it should learn well from the given training data so that it can generalize well to new, unseen data.

The default settings of an ML model may not work well for every type of problem that we try to solve. We need to manually adjust these settings for better results. Here, “settings” refer to hyperparameters.

What is a hyperparameter in an ML model?

The user manually defines a hyperparameter value before the training process, and it does not learn its value from the data during the model training process. Once defined, its value remains fixed until it is changed by the user.

We need to distinguish between a hyperparameter and a parameter. 

A parameter learns its value from the given data, and its value depends on the values of hyperparameters. A parameter value is updated during the training process.

Here is an example of how different hyperparameter values affect the Support Vector Machine (SVM) model.

from sklearn.svm import SVC

clf_1 = SVC(kernel='linear')
clf_2 = SVC(C, kernel='poly', degree=3)
clf_3 = SVC(C, kernel='poly', degree=1)

Both clf_1 and clf_3 models perform SVM linear classification, while the clf_2 model performs non-linear classification. In this case, the user can perform both linear and non-linear classification tasks by changing the value of the ‘kernel’ hyperparameter in the SVC() class.

What is hyperparameter tuning?

Hyperparameter tuning is an iterative process of optimizing a model’s performance by finding the optimal values for hyperparameters without causing overfitting. 

Sometimes, as in the above SVM example, the selection of some hyperparameters depends on the type of problem (regression or classification) that we want to solve. In that case, the user can simply set ‘linear’ for linear classification and ‘poly’ for non-linear classification. It is a simple selection.

However, for example, the user needs to use advanced searching methods to select the value for the ‘degree’ hyperparameter.

Before discussing searching methods, we need to understand two important definitions: hyperparameter search space and hyperparameter distribution.

Hyperparameter search space

The hyperparameter search space contains a set of possible hyperparameter value combinations defined by the user. The search will be limited to this space. 

The search space can be n-dimensional, where n is a positive integer.

The number of dimensions in the search space is the number of hyperparameters. (e.g 3-dimensional — 3 hyperparameters).

The search space is defined as a Python dictionary which contains hyperparameter names as keys and values for those hyperparameters as lists of values.

search_space = {'hyparam_1':[val_1, val_2],
                'hyparam_2':[val_1, val_2],
                'hyparam_3':['str_val_1', 'str_val_2']}

Hyperparameter distribution

The underlying distribution of a hyperparameter is also important because it decides how each value will be tested during the tuning process. There are four types of popular distributions.

  • Uniform distribution: All possible values within the search space will be equally selected.
  • Log-uniform distribution: A logarithmic scale is applied to uniformly distributed values. This is useful when the range of hyperparameters is large. 
  • Normal distribution: Values are distributed around a zero mean and a standard deviation of 1. 
  • Log-normal distribution: A logarithmic scale is applied to normally distributed values. This is useful when the range of hyperparameters is large.

The choice of the distribution also depends on the type of value of the hyperparameter. A hyperparameter can take discrete or continuous values. A discrete value can be an integer or a string, while a continuous value always takes floating-point numbers.

from scipy.stats import randint, uniform, loguniform, norm

# Define the parameter distributions
param_distributions = {
    'hyparam_1': randint(low=50, high=75),
    'hyparam_2': uniform(loc=0.01, scale=0.19),
    'hyparam_3': loguniform(0.1, 1.0)
}
  • randint(50, 75): Selects random integers in between 50 and 74
  • uniform(0.01, 0.49): Selects floating-point numbers evenly between 0.01 and 0.5 (continuous uniform distribution)
  • loguniform(0.1, 1.0): Selects values between 0.1 and 1.0 on a log scale (log-uniform distribution)

Hyperparameter tuning methods

There are many different types of hyperparameter tuning methods. In this article, we will focus on only three methods that fall under the exhaustive search category. In an exhaustive search, the search algorithm exhaustively searches the entire search space. There are three methods in this category: manual search, grid search and random search.

Manual search

There is no search algorithm to perform a manual search. The user just sets some values based on instinct and sees the results. If the result is not good, the user tries another value and so on. The user learns from previous attempts will set better values in future attempts. Therefore, manual search falls under the informed search category. 

There is no clear definition of the hyperparameter search space in manual search. This method can be time-consuming, but it may be useful when combined with other methods such as grid search or random search.

Manual search becomes difficult when we have to search two or more hyperparameters at once. 

An example for manual search is that the user can simply set ‘linear’ for linear classification and ‘poly’ for non-linear classification in an SVM model.

from sklearn.svm import SVC

linear_clf = SVC(kernel='linear')
non_linear_clf = SVC(C, kernel='poly')

Grid search

In grid search, the search algorithm tests all possible hyperparameter combinations defined in the search space. Therefore, this method is a brute-force method. This method is time-consuming and requires more computational power, especially when the number of hyperparameters increases (curse of dimensionality).

To use this method effectively, we need to have a well-defined hyperparameter search space. Otherwise, we will waste a lot of time testing unnecessary combinations.

However, the user does not need to specify the distribution of hyperparameters. 

The search algorithm does not learn from previous attempts (iterations) and therefore does not try better values in future attempts. Therefore, grid search falls under the uninformed search category.

Random search

In random search, the search algorithm randomly tests hyperparameter values in each iteration. Like in grid search, it does not learn from previous attempts and therefore does not try better values in future attempts. Therefore, random search also falls under uninformed search.

Grid search vs random search (Image by author)

Random search is much better than grid search when there is a large search space and we have no idea about the hyperparameter space. It is also considered computationally efficient. 

When we provide the same size of hyperparameter space for grid search and random search, we can’t see much difference between the two. We have to define a bigger search space in order to take advantage of random search over grid search. 

There are two ways to increase the size of the hyperparameter search space. 

  • By increasing the dimensionality (adding new hyperparameters)
  • By widening the range of hyperparameters

It is recommended to define the underlying distribution for each hyperparameter. If not defined, the algorithm will use the default one, which is the uniform distribution in which all combinations will have the same probability of being chosen. 

There are two important hyperparameters in the random search method itself!

  • n_iter: The number of iterations or the size of the random sample of hyperparameter combinations to test. Takes an integer. This trades off runtime vs quality of the output. We need to define this to allow the algorithm to test a random sample of combinations.
  • random_state: We need to define this hyperparameter to get the same output across multiple function calls.

The major disadvantage of random search is that it produces high variance across multiple function calls of different random states. 


This is the end of today’s article.

Please let me know if you’ve any questions or feedback.

How about an AI course?

See you in the next article. Happy learning to you!

Designed and written by:
Rukshan Pramoditha

2025–08–22

Source link

#Essential #Hyperparameter #Tuning #Techniques #Machine #LearningModels

Tags: data scienceGrid SearchHyperparameter TuningModel TrainingRandom Search
Previous Post

Why wind farms attract so much misinformation and conspiracy theory

Next Post

How Technology Has Democratised The Wealth Management Sector

AiNEWS2025

AiNEWS2025

Next Post
How Technology Has Democratised The Wealth Management Sector

How Technology Has Democratised The Wealth Management Sector

Stay Connected test

  • 23.9k Followers
  • 99 Subscribers
  • Trending
  • Comments
  • Latest
A tiny new open source AI model performs as well as powerful big ones

A tiny new open source AI model performs as well as powerful big ones

0
Water Cooler Small Talk: The Birthday Paradox 🎂🎉 | by Maria Mouschoutzi, PhD | Sep, 2024

Water Cooler Small Talk: The Birthday Paradox 🎂🎉 | by Maria Mouschoutzi, PhD | Sep, 2024

0
Ghost of Yōtei: The acclaimed Ghost of Tsushima is getting a sequel

Ghost of Yōtei: The acclaimed Ghost of Tsushima is getting a sequel

0
Best Headphones for Working Out (2024): Bose, Shokz, JLab

Best Headphones for Working Out (2024): Bose, Shokz, JLab

0
MIT engineers design an aerial microrobot that can fly as fast as a bumblebee

MIT engineers design an aerial microrobot that can fly as fast as a bumblebee

2025-12-31
Production-Ready LLMs Made Simple with the NeMo Agent Toolkit

Production-Ready LLMs Made Simple with the NeMo Agent Toolkit

2025-12-31
Here we go again: Retiring coal plant forced to stay open by Trump Admin

Here we go again: Retiring coal plant forced to stay open by Trump Admin

2025-12-31
Why inventing new emotions feels so good

Why inventing new emotions feels so good

2025-12-31

Recent News

MIT engineers design an aerial microrobot that can fly as fast as a bumblebee

MIT engineers design an aerial microrobot that can fly as fast as a bumblebee

2025-12-31
Production-Ready LLMs Made Simple with the NeMo Agent Toolkit

Production-Ready LLMs Made Simple with the NeMo Agent Toolkit

2025-12-31
Here we go again: Retiring coal plant forced to stay open by Trump Admin

Here we go again: Retiring coal plant forced to stay open by Trump Admin

2025-12-31
Why inventing new emotions feels so good

Why inventing new emotions feels so good

2025-12-31
Footer logo

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Check our landing page for details.

Follow Us

Browse by Category

  • AI & Cloud Computing
  • AI & Cybersecurity
  • AI & Sentiment Analysis
  • AI Applications
  • AI Ethics
  • AI Future Predictions
  • AI in Education
  • AI in Fintech
  • AI in Gaming
  • AI in Healthcare
  • AI in Startups
  • AI Innovations
  • AI News
  • AI Research
  • AI Tools & Automation
  • Apps
  • AR/VR & AI
  • Business
  • Deep Learning
  • Emerging Technologies
  • Entertainment
  • Fashion
  • Food
  • Gadget
  • Gaming
  • Health
  • Lifestyle
  • Machine Learning
  • Mobile
  • Movie
  • Music
  • News
  • Politics
  • Review
  • Robotics & Smart Systems
  • Science
  • Sports
  • Startup
  • Tech
  • Travel
  • World

Recent News

MIT engineers design an aerial microrobot that can fly as fast as a bumblebee

MIT engineers design an aerial microrobot that can fly as fast as a bumblebee

2025-12-31
Production-Ready LLMs Made Simple with the NeMo Agent Toolkit

Production-Ready LLMs Made Simple with the NeMo Agent Toolkit

2025-12-31
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2026 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
No Result
View All Result

© 2026 JNews - Premium WordPress news & magazine theme by Jegtheme.