diff --git a/formation_indus_ds_avancee/train_and_predict.py b/formation_indus_ds_avancee/train_and_predict.py index ea8b56f..8a8c8e9 100644 --- a/formation_indus_ds_avancee/train_and_predict.py +++ b/formation_indus_ds_avancee/train_and_predict.py @@ -18,7 +18,11 @@ def train_model(features: pd.DataFrame, model_registry_folder: str) -> None: y = features[target] model = RandomForestRegressor(n_estimators=1, max_depth=10, n_jobs=1) model.fit(X, y) - joblib.dump(model, os.path.join(model_registry_folder, 'model.joblib')) + + + timestr = time.strftime("%Y%m%d-%H%M%S") + + joblib.dump(model, os.path.join(model_registry_folder, f'model_{timestr}.joblib')) def predict_with_io(features_path: str, model_path: str, predictions_folder: str) -> None: