Getatlas 2z0gl7v1xeMOSTLY AI
Help CenterModelsModel Hyperparameter Tuning

Model Hyperparameter Tuning

Last updated July 29, 2024

Hyperparameters are settings that control the learning process of a machine learning model. Unlike model parameters, which are learned from data during training, hyperparameters are set before training and influence how the model learns. Tuning these hyperparameters carefully can significantly impact model performance and prevent overfitting.

Understanding Hyperparameters

  • Learning Rate: Controls how rapidly the model updates its weights during training. A high learning rate can lead to instability, while a low learning rate can result in slow training.
  • Epochs: The number of times the model iterates through the entire training dataset. More epochs allow for more learning but can lead to overfitting.
  • Batch Size: The number of training examples used in each update during training. Smaller batch sizes can lead to more frequent updates but might be computationally expensive.
  • Regularization Strength: Controls the complexity of the model, preventing it from overfitting. Higher regularization penalties reduce the model's ability to fit the training data too closely.
  • Number of Trees (Ensemble Models): In ensemble models like Random Forests, this determines the number of decision trees used in the ensemble.
  • Depth of Trees (Decision Trees): Controls the maximum depth of individual trees in Decision Tree models. Deeper trees can capture complex relationships but also risk overfitting.

Hyperparameter Tuning Techniques

  • Grid Search: Evaluates model performance over a predefined grid of hyperparameter values. It systematically tries all combinations of values.
  • Random Search: Randomly samples hyperparameter values from a specified distribution. Can be more efficient than grid search for high-dimensional hyperparameter spaces.
  • Bayesian Optimization:Uses past evaluations to guide the search for optimal hyperparameters, often more efficient than grid or random search for complex models.
  • Early Stopping: Stops training early if the model's performance on a validation set starts to degrade, preventing overfitting.
  • Cross-Validation: Splits the training data into multiple folds and trains and evaluates the model on different combinations of folds to get a more robust evaluation.

Performing Hyperparameter Tuning in Mostly AI

  • Navigate to the "Models" Section: Go to the "Models" section of your project.
  • Choose Hyperparameter Tuning: Select the hyperparameter tuning option for your chosen model.
  • Select Tuning Method: Choose a tuning technique (Grid Search, Random Search, Bayesian Optimization).
  • Define Parameter Ranges: Specify the ranges of values to explore for each hyperparameter.
  • Start Tuning: Initiate the tuning process. The platform will evaluate the model's performance across different hyperparameter combinations.
  • View Results: Review the tuning results and identify the best performing hyperparameters.
  • Retrain with Best Parameters: Re-train your model using the optimal hyperparameters identified through tuning.

By understanding and utilizing various hyperparameter tuning techniques, you can build more robust and effective machine learning models within Mostly AI.

Was this article helpful?