Close Menu
    Facebook LinkedIn YouTube WhatsApp X (Twitter) Pinterest
    Trending
    • Australia’s privacy commissioner tried, in vain, to sound the alarm on data protection during the u16s social media ban trials
    • Nothing Phone (4a) Pro Review: A Close Second
    • Match Group CEO Spencer Rascoff says growing women’s share on Tinder is his “primary focus” to stem user declines; Sensor Tower says 75% of Tinder users are men (Kieran Smith/Financial Times)
    • Today’s NYT Connections Hints, Answers for April 20 #1044
    • AI Machine-Vision Earns Man Overboard Certification
    • Battery recycling startup Renewable Metals charges up on $12 million Series A
    • The Influencers Normalizing Not Having Sex
    • Sources say NSA is using Mythos Preview, and a source says it is also being used widely within the DoD, despite Anthropic’s designation as a supply chain risk (Axios)
    Facebook LinkedIn WhatsApp
    Times FeaturedTimes Featured
    Monday, April 20
    • Home
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    • More
      • AI
      • Robotics
      • Industries
      • Global
    Times FeaturedTimes Featured
    Home»Artificial Intelligence»Three Essential Hyperparameter Tuning Techniques for Better Machine Learning Models
    Artificial Intelligence

    Three Essential Hyperparameter Tuning Techniques for Better Machine Learning Models

    Editor Times FeaturedBy Editor Times FeaturedAugust 24, 2025No Comments7 Mins Read
    Facebook Twitter Pinterest Telegram LinkedIn Tumblr WhatsApp Email
    Share
    Facebook Twitter LinkedIn Pinterest Telegram Email WhatsApp Copy Link


    Studying (ML) mannequin mustn’t memorize the coaching information. As a substitute, it ought to study effectively from the given coaching information in order that it may possibly generalize effectively to new, unseen information.

    The default settings of an ML mannequin might not work effectively for each sort of downside that we attempt to remedy. We have to manually alter these settings for higher outcomes. Right here, “settings” check with hyperparameters.

    What’s a hyperparameter in an ML mannequin?

    The consumer manually defines a hyperparameter worth earlier than the coaching course of, and it doesn’t study its worth from the info in the course of the mannequin coaching course of. As soon as outlined, its worth stays fastened till it’s modified by the consumer.

    We have to distinguish between a hyperparameter and a parameter. 

    A parameter learns its worth from the given information, and its worth is determined by the values of hyperparameters. A parameter worth is up to date in the course of the coaching course of.

    Right here is an instance of how completely different hyperparameter values have an effect on the Assist Vector Machine (SVM) mannequin.

    from sklearn.svm import SVC
    
    clf_1 = SVC(kernel='linear')
    clf_2 = SVC(C, kernel='poly', diploma=3)
    clf_3 = SVC(C, kernel='poly', diploma=1)

    Each clf_1 and clf_3 fashions carry out SVM linear classification, whereas the clf_2 mannequin performs non-linear classification. On this case, the consumer can carry out each linear and non-linear classification duties by altering the worth of the ‘kernel’ hyperparameter within the SVC() class.

    What’s hyperparameter tuning?

    Hyperparameter tuning is an iterative strategy of optimizing a mannequin’s efficiency by discovering the optimum values for hyperparameters with out inflicting overfitting. 

    Generally, as within the above SVM instance, the collection of some hyperparameters is determined by the kind of downside (regression or classification) that we need to remedy. In that case, the consumer can merely set ‘linear’ for linear classification and ‘poly’ for non-linear classification. It’s a easy choice.

    Nonetheless, for instance, the consumer wants to make use of superior looking out strategies to pick the worth for the ‘diploma’ hyperparameter.

    Earlier than discussing looking out strategies, we have to perceive two necessary definitions: hyperparameter search house and hyperparameter distribution.

    Hyperparameter search house

    The hyperparameter search house comprises a set of attainable hyperparameter worth combos outlined by the consumer. The search can be restricted to this house. 

    The search house may be n-dimensional, the place n is a optimistic integer.

    The variety of dimensions within the search house is the variety of hyperparameters. (e.g third-dimensional — 3 hyperparameters).

    The search house is outlined as a Python dictionary which comprises hyperparameter names as keys and values for these 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 can also be necessary as a result of it decides how every worth can be examined in the course of the tuning course of. There are 4 varieties of well-liked distributions.

    • Uniform distribution: All attainable values throughout the search house can be equally chosen.
    • Log-uniform distribution: A logarithmic scale is utilized to uniformly distributed values. That is helpful when the vary of hyperparameters is giant. 
    • Regular distribution: Values are distributed round a zero imply and a normal deviation of 1. 
    • Log-normal distribution: A logarithmic scale is utilized to usually distributed values. That is helpful when the vary of hyperparameters is giant.

    The selection of the distribution additionally is determined by the kind of worth of the hyperparameter. A hyperparameter can take discrete or steady values. A discrete worth may be an integer or a string, whereas a steady worth all the time takes floating-point numbers.

    from scipy.stats import randint, uniform, loguniform, norm
    
    # Outline the parameter distributions
    param_distributions = {
        'hyparam_1': randint(low=50, excessive=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 (steady uniform distribution)
    • loguniform(0.1, 1.0): Selects values between 0.1 and 1.0 on a log scale (log-uniform distribution)

    Hyperparameter tuning strategies

    There are various various kinds of hyperparameter tuning strategies. On this article, we’ll concentrate on solely three strategies that fall underneath the exhaustive search class. In an exhaustive search, the search algorithm exhaustively searches your complete search house. There are three strategies on this class: guide search, grid search and random search.

    Handbook search

    There isn’t a search algorithm to carry out a guide search. The consumer simply units some values based mostly on intuition and sees the outcomes. If the consequence shouldn’t be good, the consumer tries one other worth and so forth. The consumer learns from earlier makes an attempt will set higher values in future makes an attempt. Subsequently, guide search falls underneath the knowledgeable search class. 

    There isn’t a clear definition of the hyperparameter search house in guide search. This methodology may be time-consuming, however it could be helpful when mixed with different strategies reminiscent of grid search or random search.

    Handbook search turns into tough when we now have to go looking two or extra hyperparameters without delay. 

    An instance for guide search is that the consumer can merely set ‘linear’ for linear classification and ‘poly’ for non-linear classification in an SVM mannequin.

    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 assessments all attainable hyperparameter combos outlined within the search house. Subsequently, this methodology is a brute-force methodology. This methodology is time-consuming and requires extra computational energy, particularly when the variety of hyperparameters will increase (curse of dimensionality).

    To make use of this methodology successfully, we have to have a well-defined hyperparameter search house. In any other case, we’ll waste quite a lot of time testing pointless combos.

    Nonetheless, the consumer doesn’t must specify the distribution of hyperparameters. 

    The search algorithm doesn’t study from earlier makes an attempt (iterations) and due to this fact doesn’t strive higher values in future makes an attempt. Subsequently, grid search falls underneath the uninformed search class.

    Random search

    In random search, the search algorithm randomly assessments hyperparameter values in every iteration. Like in grid search, it doesn’t study from earlier makes an attempt and due to this fact doesn’t strive higher values in future makes an attempt. Subsequently, random search additionally falls underneath uninformed search.

    Grid search vs random search (Picture by creator)

    Random search is significantly better than grid search when there’s a giant search house and we do not know concerning the hyperparameter house. It is usually thought of computationally environment friendly. 

    After we present the identical measurement of hyperparameter house for grid search and random search, we will’t see a lot distinction between the 2. We have now to outline a much bigger search house with the intention to benefit from random search over grid search. 

    There are two methods to extend the dimensions of the hyperparameter search house. 

    • By growing the dimensionality (including new hyperparameters)
    • By widening the vary of hyperparameters

    It’s endorsed to outline the underlying distribution for every hyperparameter. If not outlined, the algorithm will use the default one, which is the uniform distribution during which all combos may have the identical chance of being chosen. 

    There are two necessary hyperparameters within the random search methodology itself!

    • n_iter: The variety of iterations or the dimensions of the random pattern of hyperparameter combos to check. Takes an integer. This trades off runtime vs high quality of the output. We have to outline this to permit the algorithm to check a random pattern of combos.
    • random_state: We have to outline this hyperparameter to get the identical output throughout a number of operate calls.

    The foremost drawback of random search is that it produces excessive variance throughout a number of operate calls of various random states. 


    That is the tip of immediately’s article.

    Please let me know for those who’ve any questions or suggestions.

    How about an AI course?

    See you within the subsequent article. Comfortable studying to you!

    Designed and written by:
    Rukshan Pramoditha

    2025–08–22



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    Editor Times Featured
    • Website

    Related Posts

    KV Cache Is Eating Your VRAM. Here’s How Google Fixed It With TurboQuant.

    April 19, 2026

    Proxy-Pointer RAG: Structure Meets Scale at 100% Accuracy with Smarter Retrieval

    April 19, 2026

    Dreaming in Cubes | Towards Data Science

    April 19, 2026

    AI Agents Need Their Own Desk, and Git Worktrees Give Them One

    April 18, 2026

    Your RAG System Retrieves the Right Data — But Still Produces Wrong Answers. Here’s Why (and How to Fix It).

    April 18, 2026

    Europe Warns of a Next-Gen Cyber Threat

    April 18, 2026

    Comments are closed.

    Editors Picks

    Australia’s privacy commissioner tried, in vain, to sound the alarm on data protection during the u16s social media ban trials

    April 20, 2026

    Nothing Phone (4a) Pro Review: A Close Second

    April 20, 2026

    Match Group CEO Spencer Rascoff says growing women’s share on Tinder is his “primary focus” to stem user declines; Sensor Tower says 75% of Tinder users are men (Kieran Smith/Financial Times)

    April 20, 2026

    Today’s NYT Connections Hints, Answers for April 20 #1044

    April 20, 2026
    Categories
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    About Us
    About Us

    Welcome to Times Featured, an AI-driven entrepreneurship growth engine that is transforming the future of work, bridging the digital divide and encouraging younger community inclusion in the 4th Industrial Revolution, and nurturing new market leaders.

    Empowering the growth of profiles, leaders, entrepreneurs businesses, and startups on international landscape.

    Asia-Middle East-Europe-North America-Australia-Africa

    Facebook LinkedIn WhatsApp
    Featured Picks

    Intimate Chatbot Features and Pricing Model

    February 3, 2026

    AI chatbots can sway voters better than political advertisements

    December 4, 2025

    Ford Kills the All-Electric F-150 as It Rethinks Its EV Ambitions

    December 16, 2025
    Categories
    • Founders
    • Startups
    • Technology
    • Profiles
    • Entrepreneurs
    • Leaders
    • Students
    • VC Funds
    Copyright © 2024 Timesfeatured.com IP Limited. All Rights.
    • Privacy Policy
    • Disclaimer
    • Terms and Conditions
    • About us
    • Contact us

    Type above and press Enter to search. Press Esc to cancel.