scikit-learn icon indicating copy to clipboard operation
scikit-learn copied to clipboard

Updating `root_mean_squared_log_error` & `mean_squared_log_error`

Open virchan opened this issue 1 year ago • 4 comments

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.

virchan avatar Aug 23 '24 22:08 virchan

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: 2dc3d93. Link to the linter CI: here

github-actions[bot] avatar Aug 23 '24 22:08 github-actions[bot]

I've added the API test and updated the 1.6 changelog, working towards to pass the tests.

virchan avatar Aug 26 '24 20:08 virchan

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!

virchan avatar Aug 27 '24 03:08 virchan

cc @OmarManzoor @betatim @ogrisel as well re array-api.

adrinjalali avatar Aug 27 '24 07:08 adrinjalali

Thanks for the updates @virchan.

The Cuda tests are not passing for root_mean_squared_log_error probably because it calls root_mean_squared_error which 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!

virchan avatar Aug 29 '24 01:08 virchan

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.

OmarManzoor avatar Aug 30 '24 07:08 OmarManzoor

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!

virchan avatar Aug 30 '24 19:08 virchan

I'd like to see what @ogrisel thinks here.

adrinjalali avatar Sep 12 '24 12:09 adrinjalali

Thank you for your time!

virchan avatar Sep 27 '24 15:09 virchan

I realized I merged with running the CUDA CI first... Let's be hopeful...

ogrisel avatar Sep 27 '24 18:09 ogrisel

At least the tests pass with pytorch on MPS device, I tried locally.

ogrisel avatar Sep 27 '24 18:09 ogrisel

All is fine with CUDA apparently: https://github.com/scikit-learn/scikit-learn/actions/runs/11076066477/job/30778541141

ogrisel avatar Sep 27 '24 19:09 ogrisel