Skip to content

Commit

Permalink
Improve more prog. bars compatiblity w/ Notebooks
Browse files Browse the repository at this point in the history
  • Loading branch information
sergioburdisso committed Feb 22, 2020
1 parent f1b6e67 commit 8d163d9
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pyss3/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,7 @@ def __grid_search_loop__(
disable=not extended_pbar
)

verbosity = Print.get_verbosity()
Print.set_verbosity(VERBOSITY.QUIET)
Print.verbosity_region_begin(VERBOSITY.QUIET)

for s, l, p in slp_list:
clf.set_hyperparameters(s, l, p)
Expand Down Expand Up @@ -1312,15 +1311,15 @@ def kfold_cross_validation(

clf_fold = SS3()
clf_fold.set_hyperparameters(s, l, p, a)
Print.set_verbosity(VERBOSITY.QUIET)
Print.verbosity_region_begin(VERBOSITY.QUIET)
progress_bar.set_description_str(pbar_desc + " [training...]")
clf_fold.fit(x_train_fold, y_train_fold, n_grams, leave_pbar=False)

progress_bar.set_description_str(pbar_desc + " [classifying...]")
y_pred = clf_fold.predict(
x_test_fold, def_cat, labels=False, leave_pbar=False
)
Print.set_verbosity(VERBOSITY.NORMAL)
Print.verbosity_region_end()

Evaluation.__evaluation_result__(
clf_fold, y_test_fold, y_pred,
Expand Down

0 comments on commit 8d163d9

Please sign in to comment.