DOC add an example in randomizedSearchCV docstring
@@ -1411,6 +1411,21 @@ class RandomizedSearchCV(BaseSearchCV):
A generator over parameter settings, constructed from
param_distributions.
+
+ Examples
+ --------
+ >>> from sklearn.datasets import load_iris
+ >>> from sklearn.linear_model import LogisticRegression
+ >>> from sklearn.model_selection import RandomizedSearchCV
+ >>> from scipy.stats import uniform
+ >>> iris = load_iris()
+ >>> logistic = LogisticRegression(solver='saga', tol=1e-2, max_iter=200)
+ >>> distributions = dict(C=uniform(loc=0, scale=4),
+ ... penalty=['l2', 'l1'])
+ >>> clf = RandomizedSearchCV(logistic, distributions, random_state=0)
+ >>> search = clf.fit(iris.data, iris.target)
+ >>> search.best_params_
+ {'C': 2..., 'penalty': 'l1'}
"""
_required_parameters = ["estimator", "param_distributions"]
