Skip to content

Sklearn hyperparams

Patrick Godwin requested to merge sklearn_hyperparams into master

This merge request adds a few things to the sklearn classifiers:

  • Adds some verbosity when setting up the models. In particular, it will write out the model parameters and if grid or randomized hyperparameter tuning is set up, it will also write out the parameter space it will look at and the total number of searches it will need to do.
  • Add some reproducibility by setting random_seed in the classifier. This sets a np.random.seed so that running RandomizedSearchCV for example, will end up sampling the same space. Default seed is 37, because I picked some random number out of a hat.
  • modified config2param_grid and config2param_dist in configparser.py to also optionally take in lists. This allows lists of parameters to be taken in by the hyperparameter searches seamlessly which was one drawback of the current implementation. So now for example, you can sample different optimizers as part of the search for the neural network implementation by passing in classifier__optimizer = ['sgd', 'adam'] which doesn't fit the setup before that only handles numerical values.
  • Fixed a typo in a class name: IncrementalMultiLayerPercepton -> IncrementalMultiLayerPerceptron

Tested all these options by hand with a small training job.

Merge request reports

Loading