easypheno.model._model_functions
Module Contents
Functions
|
Load and retrain persisted model |
|
Retrain a model based on information saved in a results overview file. |
|
Load persisted model |
- easypheno.model._model_functions.load_retrain_model(path, filename, X_retrain, y_retrain, early_stopping_point=None)
Load and retrain persisted model
- Parameters
path (pathlib.Path) – path where the model is saved
filename (str) – filename of the model
X_retrain (numpy.array) – feature matrix for retraining
y_retrain (numpy.array) – target vector for retraining
early_stopping_point (int) – optional early stopping point relevant for some models
- Returns
model instance
- Return type
- easypheno.model._model_functions.retrain_model_with_results_file(results_file_path, model_name, datasplit, outerfold_number, dataset, saved_outerfold_number=None, saved_datasplit=None)
Retrain a model based on information saved in a results overview file.
- Parameters
results_file_path (pathlib.Path) – path to the results overview file containing the information for retraining
model_name (str) – name of the model to retrain
datasplit (str) – datasplit to use
outerfold_number (int) – outerfold number to use
dataset (easypheno.preprocess.base_dataset.Dataset) – dataset for training
saved_outerfold_number (int) – outerfold number of the results file in case the model is retrained with fixed hyperparameters of one outerfold
saved_datasplit (str) – outerfold number of the results file in case the model is retrained on another datasplit
- Returns
retrained model
- Return type
- easypheno.model._model_functions.load_model(path, filename)
Load persisted model
- Parameters
path (pathlib.Path) – path where the model is saved
filename (str) – filename of the model
- Returns
model instance
- Return type