randomized_search

A simple randomized search on hyperparameters.

In contrast to grid search, not all parameter values are tried out, but rather a fixed number of parameter settings is sampled from the specified distributions. The number of parameter settings that are tried is specified in the n_iter parameter.

Note. After searching, the model is trained and ready to use.

Method call format

randomized_search(param_distributions,
                  X,
                  y=None,
                  cv=3,
                  n_iter=10,
                  partition_random_seed=0,
                  calc_cv_statistics=True, 
                  search_by_train_test_split=True,
                  refit=True, 
                  shuffle=True, 
                  stratified=None, 
                  train_size=0.8, 
                  verbose=True)

Parameters

Parameter Possible types Description Default value

param_distributions

dict

Dictionary with parameters names (string) as keys and distributions or lists of parameter settings to try. Distributions must provide a rvs method for sampling (such as those from scipy.stats.distributions).

If a list is given, it is sampled uniformly.

Required parameter