Core Concepts (AI/ML)

Hyperparameter Tuning

In shortAdjusting the settings you choose before training a model, such as the number of topics or clusters, to get better, more useful results.

Updated 24 Oct 2026· 2 min read

Hyperparameter tuning is the process of finding the best settings for a machine learning algorithm. Hyperparameters are the choices you make before or around training, such as how many topics a topic model should find, while parameters are what the model learns from the data itself. Tuning means trying different settings, measuring the results and keeping the combination that works best for your data and goal.

How it works

A typical tuning loop has four parts:

  • Choose what to tune. Each algorithm has a few settings that matter most.
  • Choose how to measure success. For supervised models that is usually accuracy or F1 on held-out data; for topic models, a coherence score plus your own reading of the topics; for clustering, metrics such as the silhouette score.
  • Search. Try values manually, in a grid of combinations (grid search), at random (random search), or with tools that learn which areas to explore next.
  • Validate. Check the winning settings on data the model has not seen, so you are not just fitting noise.

How it’s used in SEO and marketing

Most SEO projects tune a handful of familiar settings:

  • LDA: the number of topics, the number of passes, and alpha (document-topic density) and beta (topic-word density).
  • BERTopic: HDBSCAN’s min_cluster_size and min_samples, UMAP’s n_neighbors and n_components, and the embedding model.
  • K-means: the number of clusters, often chosen with the elbow method or silhouette scores.
  • Fuzzy matching: the similarity threshold above which a match is accepted.
  • Classifiers: settings such as regularisation strength in logistic regression.

Example

In MLforSEO’s LDA walkthrough, a first run on site content returns topics that blur together and a disappointing coherence score. Too high an alpha spreads too many topics across each document, and too high a beta mixes too many words into each topic. Lowering them and testing a few values for the number of topics produces fewer, sharper topics with a higher coherence score. With BERTopic on the course demo data, raising min_cluster_size split a topic that had lumped two unrelated themes together.

Limitations and things to watch

  • Tuning can overfit to one dataset. Re-check settings when your data changes.
  • Higher metric scores do not guarantee usable topics or clusters; always read the output.
  • Large grid searches can be slow and, with paid APIs, costly. Start with the two or three settings that matter most.
  • Fix random seeds while tuning, or you will not know whether a change came from the setting or from chance.

Learn it on MLforSEO

Where Hyperparameter Tuning shows up on MLforSEO

Sources and further reading

Other terms from Core Concepts (AI/ML)

See all 19 Core Concepts (AI/ML) terms →