Updating `root_mean_squared_log_error` & `mean_squared_log_error`
Reference Issues/PRs
Towards #29678
What does this implement/fix? Explain your changes.
This PR updates the root_mean_squared_log_error and the mean_squared_log_error functions in sklearn.metrics.
The functions now check whether y_true and y_pred are within the correct domain for the function $y = \log(1 + x)$, rather than $y = \log(x)$, as was previously implemented.
Any other comments?
This is the same as the PR #29686, which was closed due to re-branching.
✔️ Linting Passed
All linting checks passed. Your pull request is in excellent shape! ☀️
I've added the API test and updated the 1.6 changelog, working towards to pass the tests.
Could you please add tests and an entry under the 1.6 changelogs?
All tests have passed and it's ready for review. Thank you for your time!
cc @OmarManzoor @betatim @ogrisel as well re array-api.
Thanks for the updates @virchan.
The Cuda tests are not passing for
root_mean_squared_log_errorprobably because it callsroot_mean_squared_errorwhich currently does not support the array api.I am pasting the error information in the details tab
I didn't receive the error message on my end. Thank you for sharing it!
To address this, I've updated the root_mean_squared_error for the Array API, included it in the tests, and updated the 1.6 changelog accordingly.
All checks have passed, and it’s ready for review. Please let me know if there’s anything you’d like me to change.
Thank you for your time!
Note: I haven't checked with the mps device because a Mac setup is needed for that.
@virchan if you are working on a Mac can you test with the mps device?
@adrinjalali This is ready for a second review.
Note: I haven't checked with the mps device because a Mac setup is needed for that.
@virchan if you are working on a Mac can you test with the mps device?
I'm currently using a Windows machine, so I'm unable to test with the MPS device. Is there an alternative way for me to verify this? If there are any references I can look up, I'd appreciate that as well.
Thank you for the feedback!
I'd like to see what @ogrisel thinks here.
Thank you for your time!
I realized I merged with running the CUDA CI first... Let's be hopeful...
At least the tests pass with pytorch on MPS device, I tried locally.
All is fine with CUDA apparently: https://github.com/scikit-learn/scikit-learn/actions/runs/11076066477/job/30778541141