Skip to content

Commit

Permalink
Add configuration example that uses Bayesian hyperparam optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
dnouri committed Aug 2, 2019
1 parent dcdad5e commit 46d7686
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions docs/user/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,36 @@ passed at runtime.
'n_jobs': -1,
}
Can I use Bayesian optimization instead of grid search to tune my hyperparameters?
==================================================================================

The grid search configuration allows you to use a class other than
:class:`sklearn.grid_search.GridSearchCV` to do the hyperparameter
search. Here's an example configuration that uses `scikit-optimize
<https://scikit-optimize.github.io/>`_ to search for hyperparameters
using Bayesian optimization, assuming an :class:`sklearn.svm.SVC`
classifier:

.. code-block:: python
'grid_search': {
'__factory__': 'skopt.BayesSearchCV',
'estimator': {'__copy__': 'model'},
'n_iter': 16,
'search_spaces': {
'C': {
'__factory__': 'skopt.space.Real',
'low': 1e-6, 'high': 1e+1, 'prior': 'log-uniform',
},
'degree': {
'__factory__': 'skopt.space.Integer',
'low': 1, 'high': 20,
},
},
'return_train_score': True,
'refit': False,
'verbose': 4,
}
Can I use my cluster to run a hyperparameter search?
====================================================
Expand Down

0 comments on commit 46d7686

Please sign in to comment.