.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "examples/60_search/example_random_search.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code or to run this example in your browser via Binder .. rst-class:: sphx-glr-example-title .. _sphx_glr_examples_60_search_example_random_search.py: ============= Random Search ============= A crucial feature of *auto-sklearn* is automatically optimizing the hyperparameters through SMAC, introduced `here `_. Additionally, it is possible to use `random search `_ instead of SMAC, as demonstrated in the example below. Furthermore, the example also demonstrates how to use `Random Online Aggressive Racing (ROAR) `_ as yet another alternative optimizatino strategy. Both examples are intended to show how the optimization strategy in *auto-sklearn* can be adapted. .. GENERATED FROM PYTHON SOURCE LINES 15-27 .. code-block:: default from pprint import pprint import sklearn.model_selection import sklearn.datasets import sklearn.metrics from smac.facade.roar_facade import ROAR from smac.scenario.scenario import Scenario import autosklearn.classification .. GENERATED FROM PYTHON SOURCE LINES 28-30 Data Loading ============ .. GENERATED FROM PYTHON SOURCE LINES 30-37 .. code-block:: default X, y = sklearn.datasets.load_breast_cancer(return_X_y=True) X_train, X_test, y_train, y_test = sklearn.model_selection.train_test_split( X, y, random_state=1 ) .. GENERATED FROM PYTHON SOURCE LINES 38-40 Fit a classifier using ROAR =========================== .. GENERATED FROM PYTHON SOURCE LINES 40-92 .. code-block:: default def get_roar_object_callback( scenario_dict, seed, ta, ta_kwargs, metalearning_configurations, n_jobs, dask_client, multi_objective_algorithm, # This argument will be ignored as ROAR does not yet support multi-objective optimization multi_objective_kwargs, ): """Random online adaptive racing.""" if n_jobs > 1 or (dask_client and len(dask_client.nthreads()) > 1): raise ValueError( "Please make sure to guard the code invoking Auto-sklearn by " "`if __name__ == '__main__'` and remove this exception." ) scenario = Scenario(scenario_dict) return ROAR( scenario=scenario, rng=seed, tae_runner=ta, tae_runner_kwargs=ta_kwargs, run_id=seed, dask_client=dask_client, n_jobs=n_jobs, ) automl = autosklearn.classification.AutoSklearnClassifier( time_left_for_this_task=60, per_run_time_limit=15, tmp_folder="/tmp/autosklearn_random_search_example_tmp", initial_configurations_via_metalearning=0, # The callback to get the SMAC object get_smac_object_callback=get_roar_object_callback, ) automl.fit(X_train, y_train, dataset_name="breast_cancer") print("#" * 80) print("Results for ROAR.") # Print the final ensemble constructed by auto-sklearn via ROAR. pprint(automl.show_models(), indent=4) predictions = automl.predict(X_test) # Print statistics about the auto-sklearn run such as number of # iterations, number of models failed with a time out. print(automl.sprint_statistics()) print("Accuracy score", sklearn.metrics.accuracy_score(y_test, predictions)) .. rst-class:: sphx-glr-script-out .. code-block:: none ################################################################################ Results for ROAR. { 2: { 'balancing': Balancing(random_state=1), 'classifier': , 'cost': 0.028368794326241176, 'data_preprocessor': , 'ensemble_weight': 0.06, 'feature_preprocessor': , 'model_id': 2, 'rank': 1, 'sklearn_classifier': RandomForestClassifier(max_features=5, n_estimators=512, n_jobs=1, random_state=1, warm_start=True)}, 3: { 'balancing': Balancing(random_state=1), 'classifier': , 'cost': 0.07092198581560283, 'data_preprocessor': , 'ensemble_weight': 0.04, 'feature_preprocessor': , 'model_id': 3, 'rank': 2, 'sklearn_classifier': PassiveAggressiveClassifier(C=0.10318256510142626, average=True, max_iter=32, random_state=1, tol=0.0013607858153657413, warm_start=True)}, 4: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.08510638297872342, 'data_preprocessor': , 'ensemble_weight': 0.02, 'feature_preprocessor': , 'model_id': 4, 'rank': 3, 'sklearn_classifier': PassiveAggressiveClassifier(C=0.000505280701827856, max_iter=32, random_state=1, tol=0.06421873693006744, warm_start=True)}, 5: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.021276595744680882, 'data_preprocessor': , 'ensemble_weight': 0.04, 'feature_preprocessor': , 'model_id': 5, 'rank': 4, 'sklearn_classifier': HistGradientBoostingClassifier(early_stopping=True, l2_regularization=1.4469619760002166e-09, learning_rate=0.12309321429220763, max_iter=256, max_leaf_nodes=10, min_samples_leaf=17, n_iter_no_change=16, random_state=1, validation_fraction=None, warm_start=True)}, 7: { 'balancing': Balancing(random_state=1), 'classifier': , 'cost': 0.36879432624113473, 'data_preprocessor': , 'ensemble_weight': 0.04, 'feature_preprocessor': , 'model_id': 7, 'rank': 5, 'sklearn_classifier': BernoulliNB(alpha=0.020898102999400082)}, 8: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.028368794326241176, 'data_preprocessor': , 'ensemble_weight': 0.1, 'feature_preprocessor': , 'model_id': 8, 'rank': 6, 'sklearn_classifier': PassiveAggressiveClassifier(C=5.4951544593926646e-05, average=True, max_iter=16, random_state=1, tol=0.012344344043531127, warm_start=True)}, 9: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.12056737588652477, 'data_preprocessor': , 'ensemble_weight': 0.08, 'feature_preprocessor': , 'model_id': 9, 'rank': 7, 'sklearn_classifier': PassiveAggressiveClassifier(C=0.09581923415311244, max_iter=64, random_state=1, tol=0.000145918046557035, warm_start=True)}, 10: { 'balancing': Balancing(random_state=1), 'classifier': , 'cost': 0.16312056737588654, 'data_preprocessor': , 'ensemble_weight': 0.04, 'feature_preprocessor': , 'model_id': 10, 'rank': 8, 'sklearn_classifier': ExtraTreesClassifier(criterion='entropy', max_features=2, min_samples_leaf=11, min_samples_split=19, n_estimators=512, n_jobs=1, random_state=1, warm_start=True)}, 11: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.028368794326241176, 'data_preprocessor': , 'ensemble_weight': 0.06, 'feature_preprocessor': , 'model_id': 11, 'rank': 9, 'sklearn_classifier': LinearDiscriminantAnalysis(shrinkage='auto', solver='lsqr', tol=0.039339489121391846)}, 12: { 'balancing': Balancing(random_state=1), 'classifier': , 'cost': 0.13475177304964536, 'data_preprocessor': , 'ensemble_weight': 0.06, 'feature_preprocessor': , 'model_id': 12, 'rank': 10, 'sklearn_classifier': LinearDiscriminantAnalysis(tol=0.0004182629077658861)}, 13: { 'balancing': Balancing(random_state=1), 'classifier': , 'cost': 0.36879432624113473, 'data_preprocessor': , 'ensemble_weight': 0.02, 'feature_preprocessor': , 'model_id': 13, 'rank': 11, 'sklearn_classifier': ExtraTreesClassifier(bootstrap=True, criterion='entropy', max_features=1, min_samples_leaf=20, min_samples_split=20, n_estimators=512, n_jobs=1, random_state=1, warm_start=True)}, 14: { 'balancing': Balancing(random_state=1), 'classifier': , 'cost': 0.028368794326241176, 'data_preprocessor': , 'ensemble_weight': 0.06, 'feature_preprocessor': , 'model_id': 14, 'rank': 12, 'sklearn_classifier': LinearDiscriminantAnalysis(shrinkage='auto', solver='lsqr', tol=0.013943862590174107)}, 15: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.16312056737588654, 'data_preprocessor': , 'ensemble_weight': 0.04, 'feature_preprocessor': , 'model_id': 15, 'rank': 13, 'sklearn_classifier': DecisionTreeClassifier(class_weight='balanced', criterion='entropy', max_depth=1, min_samples_leaf=3, min_samples_split=13, random_state=1)}, 16: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.06382978723404253, 'data_preprocessor': , 'ensemble_weight': 0.02, 'feature_preprocessor': , 'model_id': 16, 'rank': 14, 'sklearn_classifier': GaussianNB()}, 17: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.07801418439716312, 'data_preprocessor': , 'ensemble_weight': 0.06, 'feature_preprocessor': , 'model_id': 17, 'rank': 15, 'sklearn_classifier': PassiveAggressiveClassifier(C=0.04885675602027957, average=True, max_iter=64, random_state=1, tol=0.0002678322187543955, warm_start=True)}, 18: { 'balancing': Balancing(random_state=1), 'classifier': , 'cost': 0.1063829787234043, 'data_preprocessor': , 'ensemble_weight': 0.1, 'feature_preprocessor': , 'model_id': 18, 'rank': 16, 'sklearn_classifier': SGDClassifier(alpha=0.0002548862311968591, average=True, eta0=4.278565071229579e-05, learning_rate='constant', loss='squared_hinge', max_iter=1024, random_state=1, tol=5.482673674397374e-05, warm_start=True)}, 19: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.09219858156028371, 'data_preprocessor': , 'ensemble_weight': 0.02, 'feature_preprocessor': , 'model_id': 19, 'rank': 17, 'sklearn_classifier': AdaBoostClassifier(base_estimator=DecisionTreeClassifier(max_depth=7), learning_rate=0.035867722843024794, n_estimators=70, random_state=1)}, 23: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.07801418439716312, 'data_preprocessor': , 'ensemble_weight': 0.04, 'feature_preprocessor': , 'model_id': 23, 'rank': 18, 'sklearn_classifier': MLPClassifier(activation='tanh', alpha=0.02522490081077779, beta_1=0.999, beta_2=0.9, early_stopping=True, hidden_layer_sizes=(35,), learning_rate_init=0.026536043936270744, max_iter=32, n_iter_no_change=32, random_state=1, verbose=0, warm_start=True)}, 24: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.028368794326241176, 'data_preprocessor': , 'ensemble_weight': 0.02, 'feature_preprocessor': , 'model_id': 24, 'rank': 19, 'sklearn_classifier': LinearDiscriminantAnalysis(shrinkage='auto', solver='lsqr', tol=0.001678686694320821)}, 25: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.021276595744680882, 'data_preprocessor': , 'ensemble_weight': 0.02, 'feature_preprocessor': , 'model_id': 25, 'rank': 20, 'sklearn_classifier': HistGradientBoostingClassifier(early_stopping=True, l2_regularization=2.1928852428306468e-08, learning_rate=0.29557366541255203, max_iter=64, max_leaf_nodes=70, min_samples_leaf=24, random_state=1, validation_fraction=0.13252036572629863, warm_start=True)}, 26: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.08510638297872342, 'data_preprocessor': , 'ensemble_weight': 0.06, 'feature_preprocessor': , 'model_id': 26, 'rank': 21, 'sklearn_classifier': KNeighborsClassifier(n_neighbors=80, p=1)}} auto-sklearn results: Dataset name: breast_cancer Metric: accuracy Best validation score: 0.978723 Number of target algorithm runs: 26 Number of successful target algorithm runs: 25 Number of crashed target algorithm runs: 0 Number of target algorithms that exceeded the time limit: 1 Number of target algorithms that exceeded the memory limit: 0 Accuracy score 0.965034965034965 .. GENERATED FROM PYTHON SOURCE LINES 93-95 Fit a classifier using Random Search ==================================== .. GENERATED FROM PYTHON SOURCE LINES 95-150 .. code-block:: default def get_random_search_object_callback( scenario_dict, seed, ta, ta_kwargs, metalearning_configurations, n_jobs, dask_client, multi_objective_algorithm, # This argument will be ignored as ROAR does not yet support multi-objective optimization multi_objective_kwargs, ): """Random search""" if n_jobs > 1 or (dask_client and len(dask_client.nthreads()) > 1): raise ValueError( "Please make sure to guard the code invoking Auto-sklearn by " "`if __name__ == '__main__'` and remove this exception." ) scenario_dict["minR"] = len(scenario_dict["instances"]) scenario_dict["initial_incumbent"] = "RANDOM" scenario = Scenario(scenario_dict) return ROAR( scenario=scenario, rng=seed, tae_runner=ta, tae_runner_kwargs=ta_kwargs, run_id=seed, dask_client=dask_client, n_jobs=n_jobs, ) automl = autosklearn.classification.AutoSklearnClassifier( time_left_for_this_task=60, per_run_time_limit=15, tmp_folder="/tmp/autosklearn_random_search_example_tmp", initial_configurations_via_metalearning=0, # Passing the callback to get the SMAC object get_smac_object_callback=get_random_search_object_callback, ) automl.fit(X_train, y_train, dataset_name="breast_cancer") print("#" * 80) print("Results for random search.") # Print the final ensemble constructed by auto-sklearn via random search. pprint(automl.show_models(), indent=4) # Print statistics about the auto-sklearn run such as number of # iterations, number of models failed with a time out. print(automl.sprint_statistics()) predictions = automl.predict(X_test) print("Accuracy score", sklearn.metrics.accuracy_score(y_test, predictions)) .. rst-class:: sphx-glr-script-out .. code-block:: none ################################################################################ Results for random search. { 3: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.08510638297872342, 'data_preprocessor': , 'ensemble_weight': 0.04, 'feature_preprocessor': , 'model_id': 3, 'rank': 1, 'sklearn_classifier': PassiveAggressiveClassifier(C=0.000505280701827856, max_iter=32, random_state=1, tol=0.06421873693006744, warm_start=True)}, 4: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.021276595744680882, 'data_preprocessor': , 'ensemble_weight': 0.06, 'feature_preprocessor': , 'model_id': 4, 'rank': 2, 'sklearn_classifier': HistGradientBoostingClassifier(early_stopping=True, l2_regularization=1.4469619760002166e-09, learning_rate=0.12309321429220763, max_iter=256, max_leaf_nodes=10, min_samples_leaf=17, n_iter_no_change=16, random_state=1, validation_fraction=None, warm_start=True)}, 5: { 'balancing': Balancing(random_state=1), 'classifier': , 'cost': 0.028368794326241176, 'data_preprocessor': , 'ensemble_weight': 0.14, 'feature_preprocessor': , 'model_id': 5, 'rank': 3, 'sklearn_classifier': RandomForestClassifier(max_features=5, n_estimators=512, n_jobs=1, random_state=1, warm_start=True)}, 6: { 'balancing': Balancing(random_state=1), 'classifier': , 'cost': 0.028368794326241176, 'data_preprocessor': , 'ensemble_weight': 0.06, 'feature_preprocessor': , 'model_id': 6, 'rank': 4, 'sklearn_classifier': LinearDiscriminantAnalysis(tol=0.08622878828999171)}, 7: { 'balancing': Balancing(random_state=1), 'classifier': , 'cost': 0.36879432624113473, 'data_preprocessor': , 'ensemble_weight': 0.04, 'feature_preprocessor': , 'model_id': 7, 'rank': 5, 'sklearn_classifier': BernoulliNB(alpha=0.020898102999400082)}, 9: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.12056737588652477, 'data_preprocessor': , 'ensemble_weight': 0.06, 'feature_preprocessor': , 'model_id': 9, 'rank': 6, 'sklearn_classifier': PassiveAggressiveClassifier(C=0.09581923415311244, max_iter=64, random_state=1, tol=0.000145918046557035, warm_start=True)}, 10: { 'balancing': Balancing(random_state=1), 'classifier': , 'cost': 0.16312056737588654, 'data_preprocessor': , 'ensemble_weight': 0.06, 'feature_preprocessor': , 'model_id': 10, 'rank': 7, 'sklearn_classifier': ExtraTreesClassifier(criterion='entropy', max_features=2, min_samples_leaf=11, min_samples_split=19, n_estimators=512, n_jobs=1, random_state=1, warm_start=True)}, 11: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.028368794326241176, 'data_preprocessor': , 'ensemble_weight': 0.06, 'feature_preprocessor': , 'model_id': 11, 'rank': 8, 'sklearn_classifier': LinearDiscriminantAnalysis(shrinkage='auto', solver='lsqr', tol=0.039339489121391846)}, 12: { 'balancing': Balancing(random_state=1), 'classifier': , 'cost': 0.13475177304964536, 'data_preprocessor': , 'ensemble_weight': 0.08, 'feature_preprocessor': , 'model_id': 12, 'rank': 9, 'sklearn_classifier': LinearDiscriminantAnalysis(tol=0.0004182629077658861)}, 13: { 'balancing': Balancing(random_state=1), 'classifier': , 'cost': 0.36879432624113473, 'data_preprocessor': , 'ensemble_weight': 0.02, 'feature_preprocessor': , 'model_id': 13, 'rank': 10, 'sklearn_classifier': ExtraTreesClassifier(bootstrap=True, criterion='entropy', max_features=1, min_samples_leaf=20, min_samples_split=20, n_estimators=512, n_jobs=1, random_state=1, warm_start=True)}, 14: { 'balancing': Balancing(random_state=1), 'classifier': , 'cost': 0.028368794326241176, 'data_preprocessor': , 'ensemble_weight': 0.04, 'feature_preprocessor': , 'model_id': 14, 'rank': 11, 'sklearn_classifier': LinearDiscriminantAnalysis(shrinkage='auto', solver='lsqr', tol=0.013943862590174107)}, 15: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.16312056737588654, 'data_preprocessor': , 'ensemble_weight': 0.04, 'feature_preprocessor': , 'model_id': 15, 'rank': 12, 'sklearn_classifier': DecisionTreeClassifier(class_weight='balanced', criterion='entropy', max_depth=1, min_samples_leaf=3, min_samples_split=13, random_state=1)}, 16: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.06382978723404253, 'data_preprocessor': , 'ensemble_weight': 0.02, 'feature_preprocessor': , 'model_id': 16, 'rank': 13, 'sklearn_classifier': GaussianNB()}, 17: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.07801418439716312, 'data_preprocessor': , 'ensemble_weight': 0.02, 'feature_preprocessor': , 'model_id': 17, 'rank': 14, 'sklearn_classifier': PassiveAggressiveClassifier(C=0.04885675602027957, average=True, max_iter=64, random_state=1, tol=0.0002678322187543955, warm_start=True)}, 18: { 'balancing': Balancing(random_state=1), 'classifier': , 'cost': 0.1063829787234043, 'data_preprocessor': , 'ensemble_weight': 0.06, 'feature_preprocessor': , 'model_id': 18, 'rank': 15, 'sklearn_classifier': SGDClassifier(alpha=0.0002548862311968591, average=True, eta0=4.278565071229579e-05, learning_rate='constant', loss='squared_hinge', max_iter=1024, random_state=1, tol=5.482673674397374e-05, warm_start=True)}, 19: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.09219858156028371, 'data_preprocessor': , 'ensemble_weight': 0.02, 'feature_preprocessor': , 'model_id': 19, 'rank': 16, 'sklearn_classifier': AdaBoostClassifier(base_estimator=DecisionTreeClassifier(max_depth=7), learning_rate=0.035867722843024794, n_estimators=70, random_state=1)}, 20: { 'balancing': Balancing(random_state=1), 'classifier': , 'cost': 0.07092198581560283, 'data_preprocessor': , 'ensemble_weight': 0.02, 'feature_preprocessor': , 'model_id': 20, 'rank': 17, 'sklearn_classifier': AdaBoostClassifier(algorithm='SAMME', base_estimator=DecisionTreeClassifier(max_depth=9), learning_rate=0.21684295401135145, n_estimators=72, random_state=1)}, 23: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.07801418439716312, 'data_preprocessor': , 'ensemble_weight': 0.02, 'feature_preprocessor': , 'model_id': 23, 'rank': 18, 'sklearn_classifier': MLPClassifier(activation='tanh', alpha=0.02522490081077779, beta_1=0.999, beta_2=0.9, early_stopping=True, hidden_layer_sizes=(35,), learning_rate_init=0.026536043936270744, max_iter=32, n_iter_no_change=32, random_state=1, verbose=0, warm_start=True)}, 24: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.028368794326241176, 'data_preprocessor': , 'ensemble_weight': 0.06, 'feature_preprocessor': , 'model_id': 24, 'rank': 19, 'sklearn_classifier': LinearDiscriminantAnalysis(shrinkage='auto', solver='lsqr', tol=0.001678686694320821)}, 25: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.021276595744680882, 'data_preprocessor': , 'ensemble_weight': 0.02, 'feature_preprocessor': , 'model_id': 25, 'rank': 20, 'sklearn_classifier': HistGradientBoostingClassifier(early_stopping=True, l2_regularization=2.1928852428306468e-08, learning_rate=0.29557366541255203, max_iter=64, max_leaf_nodes=70, min_samples_leaf=24, random_state=1, validation_fraction=0.13252036572629863, warm_start=True)}, 26: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.08510638297872342, 'data_preprocessor': , 'ensemble_weight': 0.02, 'feature_preprocessor': , 'model_id': 26, 'rank': 21, 'sklearn_classifier': KNeighborsClassifier(n_neighbors=80, p=1)}, 27: { 'balancing': Balancing(random_state=1, strategy='weighting'), 'classifier': , 'cost': 0.375886524822695, 'data_preprocessor': , 'ensemble_weight': 0.04, 'feature_preprocessor': , 'model_id': 27, 'rank': 22, 'sklearn_classifier': BernoulliNB(alpha=9.144520523203797)}} auto-sklearn results: Dataset name: breast_cancer Metric: accuracy Best validation score: 0.978723 Number of target algorithm runs: 26 Number of successful target algorithm runs: 26 Number of crashed target algorithm runs: 0 Number of target algorithms that exceeded the time limit: 0 Number of target algorithms that exceeded the memory limit: 0 Accuracy score 0.972027972027972 .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 1 minutes 56.774 seconds) .. _sphx_glr_download_examples_60_search_example_random_search.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: binder-badge .. image:: images/binder_badge_logo.svg :target: https://mybinder.org/v2/gh/automl/auto-sklearn/master?urlpath=lab/tree/notebooks/examples/60_search/example_random_search.ipynb :alt: Launch binder :width: 150 px .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: example_random_search.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: example_random_search.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_