sleepless.engine.trainer_scikit#
Training script.
Functions
|
Train script for the scikit-learn pipeline. |
|
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 fittraining_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 savedmodel_parameters (
Mapping
) – The parameters to train the model
- Return type:
- sleepless.engine.trainer_scikit.train_scikit_grid_search(grid_search, eval_set, output_folder, seed=42, early_stop=False)[source]#
Train function to train a grid-search with or without early-stop.
- Parameters:
grid_search (
Any
) – The grid search modeleval_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 savedseed (
int
) – To fix random_seed parameterearly_stop (
bool
) – activate or not the early stop
- Returns:
The best estimator found by the grid-search