ForeTiS.postprocess.model_reuse
Module Contents
Functions
|
Apply a final model on a new dataset. It will be applied to the whole dataset. |
- ForeTiS.postprocess.model_reuse.apply_final_model(results_directory_model, old_data_dir, old_data, new_data_dir, new_data, save_dir=None, config_file_path=None, retrain_model=True)
Apply a final model on a new dataset. It will be applied to the whole dataset. So the main purpose of this function is, if you get new samples you want to predict on. If the final model was saved, this will be used for inference on the new dataset. Otherwise, it will be retrained on the initial dataset and then used for inference on the new dataset.
The new dataset will be filtered for the SNP ids that the model was initially trained on.
CAUTION: the SNPs of the old and the new dataset have to be the same!
- Parameters:
results_directory_model (str) – directory that contains the model results that you want to use
new_data_dir (str) – directory that contains the new data
old_data_dir (str) – directory that contains the old data
save_dir (str) – directory to store the results
old_data (str) – the old dataset that you used
new_data (str) – the new dataset that you want to use
config_file_path (pathlib.Path) – the path to the config file you want to use
retrain_model (bool) – whether to retrain the model with the whole old dataset