sleepless.engine.trainer_scikit#

Training script.

Functions

train_scikit(model, training_set, ...)

Train script for the scikit-learn pipeline.

train_scikit_grid_search(grid_search, ...[, ...])

Train function to train a grid-search with or without early-stop.

sleepless.engine.trainer_scikit.train_scikit(model, training_set, validation_set, output_folder, model_parameters)[source]#

Train script for the scikit-learn pipeline.

Parameters:
  • model (Any) – The scikit learn model to be fit

  • training_set (list[DelayedSample]) – the training_set which need to already be transformed.

  • validation_set (list[list[DelayedSample]]) – a list of validation_set which need to already be transformed.

  • output_folder (str) – A path where the training model will be saved

  • model_parameters (Mapping) – The parameters to train the model

Return type:

None

Train function to train a grid-search with or without early-stop.

Parameters:
  • grid_search (Any) – The grid search model

  • eval_set (list[tuple[ndarray, ndarray]]) – A list of set of shape [(X_train,y_train),(X_val0,y_val0),(X_val1,y_val1),…]

  • output_folder (str) – A path where the parameters of the grid-search model will be saved

  • seed (int) – To fix random_seed parameter

  • early_stop (bool) – activate or not the early stop

Returns:

The best estimator found by the grid-search