Model Selection

Most models contain hyperparameters: parameters that are specified in the constructor, and not learned from the data. ScikitLearn.jl provides GridSearchCV to find the best set of hyper-parameter:

using ScikitLearn.GridSearch: GridSearchCV

gridsearch = GridSearchCV(LogisticRegression(), Dict(:C => 0.1:0.1:2.0))
fit!(gridsearch, X, y)
println("Best hyper-parameters: $(gridsearch.best_params_)")

See ?GridSearchCV and the scikit-learn docs for details.

Examples

RandomizedSearchCV will sample from each parameter independently. Documentation here.

Note: The distributions have to be specified using scipy.stats (see example below), but we hope to support Distributions.jl in the future. File an issue if this is a pain point.

Examples