# How do I choose random, grid, or Bayesian sampling for an Azure ML sweep?

Exam: AI-300 — Operationalizing Machine Learning and Generative AI Solutions
Knowledge domain: Implement machine learning model lifecycle and operations
Updated: 2026-11-25T04:35:30.893077+00:00
HTML: https://learningpathx.com/faq/AI-300/ai300-choose-azure-ml-sweep-sampling.html

## Also asked as

- When is each Azure Machine Learning sweep sampling method useful?
- Which Azure ML sweep sampling strategy fits my parameter space and trial budget?

Use **grid sampling** for a small finite set whose combinations you can afford to evaluate. Use **random sampling** to explore a wider space of discrete and continuous values. Consider **Bayesian sampling** when each trial is costly and completed results can guide later choices. Azure Machine Learning documents `choice`, `uniform`, and `quniform` for Bayesian sampling.

Count discrete combinations when reviewing a grid. Three settings for one parameter and two for another give six combinations before any failures. With high concurrency, a Bayesian search can launch more trials before previous results are available, so consider the trade-off with elapsed time. Record the space actually explored and any budget limit before drawing conclusions.

### Microsoft Learn

* [Hyperparameter tuning a model (v2) - Azure Machine Learning](https://learn.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters?view=azureml-api-2)

Source: [AI-300: Choosing and Comparing Training Experiments](https://learningpathx.com/news/ai-300-choosing-and-comparing-training-experiments.html)
