-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
[WIP] Fix gradient boosting overflow #7959
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
Conversation
…scikit-learn#7838) * initial commit for return_std * initial commit for return_std * adding tests, examples, ARD predict_std * adding tests, examples, ARD predict_std * a smidge more documentation * a smidge more documentation * Missed a few PEP8 issues * Changing predict_std to return_std scikit-learn#1 * Changing predict_std to return_std scikit-learn#2 * Changing predict_std to return_std scikit-learn#3 * Changing predict_std to return_std final * adding better plots via polynomial regression * trying to fix flake error * fix to ARD plotting issue * fixing some flakes * Two blank lines part 1 * Two blank lines part 2 * More newlines! * Even more newlines * adding info to the doc string for the two plot files * Rephrasing "polynomial" for Bayesian Ridge Regression * Updating "polynomia" for ARD * Adding more formal references * Another asked-for improvement to doc string. * Fixing flake8 errors * Cleaning up the tests a smidge. * A few more flakes * requested fixes from Andy * Mini bug fix * Final pep8 fix * pep8 fix round 2 * Fix beta_ to alpha_ in the comments
np.isclose was added in numpy 1.7 and we test with numpy 1.6.2 in our build matrix, this is why Travis is failing. Not sure what the best way is to tackle this, maybe compare |
There are other places using checking It would be great to add tests for this "close to 0" behaviour, not sure how easy this is. |
Thank you for the feedback. I'll take a look at the other cases where there is a float comparison on == |
I was thinking of copy pasting the isclose() from numpy
I am not sure if that is acceptable or a good idea or not, but I feel that a built-in, universal, standardized way for comparing float64 scalars and matrices is very good to have. |
I have been reading up on it and it seems that isclose() used to be there but was removed I suppose abs(x - y) < epsilon for every case of float comparison will have to do. Also speaking of float comparisons, I found this issue which also seems to have various problems with assert_equals on floats. #4400 |
@chenhe95 The function was removed because it was no longer needed. It was a bug in the ROC curve and that was the only place where the function was used. As the use got removed, so was the function. Feel free to add the backport back in if there is a new need. |
wow apparently I don't know a lot about floating point numbers. I was surprised that you can represent Shouldn't we use as epsilon here something close to |
It's kind of tricky |
yeah 1e-150 is fine :) |
Should this not depend on the data used? Maybe it's not always float64 |
@lesteve I think it is fine because: edit: If the inputs are matrices, then it will do element-wise np.isclose() which is another reason why I really like the function. Here is also a link to the numpy code I am going to port in |
…5/scikit-learn into GradientBoostingOverflow
It seems that the merge failed in updating my branch to master. |
Reference Issue
Fix #7717
What does this implement/fix? Explain your changes.
Before, the code was using == to compare float values and dividing by "zero (~10e-309)" which caused an overflow.
Now I made it so that it's