question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

percent_better_than_baseline fails when baseline is 0

See original GitHub issue

Repro: dataset X = pd.read_csv('/Users/becca.mcbrayer/Desktop/text_datasets/wine_modified.csv')[:100] y = X.pop('points') X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=42) automl_no_text = AutoMLSearch(problem_type='binary', objective='precision') automl_no_text.search(X_train, y_train)

Output: Screen Shot 2020-08-18 at 4 52 35 PM

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
eccabaycommented, Aug 18, 2020

I see, I must have missed that!

0reactions
kmax12commented, Aug 19, 2020

that’s true, but if you think about it has a percent improvement or decrease inf would make sense too. that being said, it’s a bit weird in cases where the bounds on the metric are something like (-1, 1) since a zero score would give you inf, but a slight deviation wouldnt.

so, i guess i convinced myself nan is right

Read more comments on GitHub >

github_iconTop Results From Across the Web

For some objectives where baseline was 0, "pct better than ...
@dsherry @rpeck This is expected behavior because the baseline pipeline gets a score of 0 on the objectives with NaN ( F1 ,...
Read more >
Percent calcuation causes divide by zero error
I am trying to compare sales by month and i am gettting an error message. Example April Sales 20, May sales 0, i...
Read more >
How to calculate relative error when the true value is zero?
The solution to your question is to make sure you are dealing with absolute values when measuring relative error, so that zero is...
Read more >
How to calculate percentage when old value is ZERO
When P is actually zero then the concept of percentage change has no meaning. Zero to anything cannot be expressed as a rate...
Read more >
A Post Occupancy Evaluation of 22 GSA Buildings
Between 0% and 50 % Under Baseline ... measurement error, a leak, an unintended use, or an increase in the building occupant related...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found