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

Make use of verbose setting in Experiment #564

Merged
merged 1 commit into from
Dec 11, 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
11 changes: 11 additions & 0 deletions cornac/experiment/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ class Experiment:
show_validation: bool, optional, default: True
Whether to show the results on validation set (if exists).

verbose: bool, optional, default: False
Output running log/progress during model training and evaluation.
If verbose is True, it will overwrite verbosity setting of evaluation method and models.

save_dir: str, optional, default: None
Path to a directory for storing trained models and logs. If None,
models will NOT be stored and logs will be saved in the current working directory.
Expand Down Expand Up @@ -127,6 +131,13 @@ def run(self):
"""Run the Cornac experiment"""
self._create_result()

# overwrite verbosity setting of evaluation method and models
# if Experiment verbose is True
if self.verbose:
self.eval_method.verbose = self.verbose
for model in self.models:
model.verbose = self.verbose

for model in self.models:
test_result, val_result = self.eval_method.evaluate(
model=model,
Expand Down
Loading