Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove incorrect report creation #472

Merged
merged 3 commits into from
Aug 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading