Skip to content

Commit

Permalink
remove incorrect report creation (#472)
Browse files Browse the repository at this point in the history
* remove incorrect report creation

Signed-off-by: Frank Kreuwel <[email protected]>

* remove unused variable

Signed-off-by: Frank Kreuwel <[email protected]>

* Update openstef/pipeline/optimize_hyperparameters.py

Co-authored-by: Jan Maarten van Doorn <[email protected]>
Signed-off-by: Frank Kreuwel <[email protected]>

---------

Signed-off-by: Frank Kreuwel <[email protected]>
Co-authored-by: Jan Maarten van Doorn <[email protected]>
  • Loading branch information
FrankKr and JanMaartenvanDoorn authored Aug 14, 2023
1 parent 2011c17 commit 0783201
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions openstef/pipeline/optimize_hyperparameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def optimize_hyperparameters_pipeline_core(
)

best_hyperparams = study.best_params
best_model = study.user_attrs["best_model"]
# The best_model could be accessed via study.user_attrs["best_model"]

logger.info(
f"Finished hyperparameter optimization, error objective {study.best_value} "
Expand All @@ -209,17 +209,14 @@ def optimize_hyperparameters_pipeline_core(
# Train a model using the regular train pipeline.
# The train/validation/test split used in hyperparam optimisation
# is less suitable for an operational model.
best_model, report, modelspecs, _ = train_model_pipeline_core(
model, report, model_specs, _ = train_model_pipeline_core(
pj=pj, input_data=input_data, model_specs=model_specs
)

# Save model and report. Report is always saved to MLFlow and optionally to disk
report = objective.create_report(model=best_model)

trials = objective.get_trial_track()
best_trial_number = study.best_trial.number

return best_model, model_specs, report, trials, best_trial_number, study.best_params
return model, model_specs, report, trials, best_trial_number, study.best_params


def optuna_optimization(
Expand Down

0 comments on commit 0783201

Please sign in to comment.