Skip to content

Commit

Permalink
Fix compare_model errors="ignore" not handling 0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Yard1 committed Aug 22, 2021
1 parent 33a65e0 commit 5eba625
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pycaret/internal/tabular.py
Original file line number Diff line number Diff line change
Expand Up @@ -2195,8 +2195,11 @@ def compare_models(
refit=False,
)
model_results = pull(pop=True)
assert np.sum(model_results.iloc[0]) != 0.0
except:
logger.error(f"create_model() for {model} raised an exception:")
logger.error(
f"create_model() for {model} raised an exception or returned all 0.0:"
)
logger.error(traceback.format_exc())
continue
logger.info("SubProcess create_model() end ==================================")
Expand Down Expand Up @@ -2332,8 +2335,11 @@ def highlight_cols(s):
groups=groups,
)
sorted_models.append(model)
assert np.sum(model_results.iloc[0]) != 0.0
except Exception:
logger.error(f"create_model() for {model} raised an exception:")
logger.error(
f"create_model() for {model} raised an exception or returned all 0.0:"
)
logger.error(traceback.format_exc())
model = None
continue
Expand Down

0 comments on commit 5eba625

Please sign in to comment.