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

FIX: incremental estimators tests

Open samir-nasibli opened this issue 1 year ago • 3 comments

Description

fixes incremental estimators tests. Output array should be converted to numpy array before setting tol dependent on the dtype, otherwise the tol settings will not be set. Found on #1861


Checklist to comply with before moving PR from draft:

PR completeness and readability

  • [x] I have reviewed my changes thoroughly before submitting this pull request.
  • [x] I have commented my code, particularly in hard-to-understand areas.
  • [ ] I have updated the documentation to reflect the changes or created a separate PR with update and provided its number in the description, if necessary.
  • [x] Git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details).
  • [x] I have added a respective label(s) to PR if I have a permission for that.
  • [x] I have resolved any merge conflicts that might occur with the base branch.

Testing

  • [x] The unit tests pass successfully.
  • [x] I have run it locally and tested the changes extensively.

Performance

  • [ ] I have measured performance for affected algorithms using scikit-learn_bench and provided at least summary table with measured data, if performance change is expected.
  • [ ] I have provided justification why performance has changed or why changes are not expected.

samir-nasibli avatar Aug 11 '24 08:08 samir-nasibli

/intelci: run

samir-nasibli avatar Aug 11 '24 09:08 samir-nasibli

/intelci: run

samir-nasibli avatar Aug 11 '24 21:08 samir-nasibli

Rather than cast it to numpy for checking dtype, couldn't we just use the dtype test parameter? i.e. tol = 2e-6 if dtype == np.float32 else 1e-7?

All asserts require numpy inputs, so make sense convert them to numpy ndarrays. np.float32 is no clear in case of array api inputs dtype check.

samir-nasibli avatar Aug 27 '24 07:08 samir-nasibli

Rather than cast it to numpy for checking dtype, couldn't we just use the dtype test parameter? i.e. tol = 2e-6 if dtype == np.float32 else 1e-7?

agree, this is exactly what I asked in my comments

olegkkruglov avatar Aug 30 '24 14:08 olegkkruglov

/intelci: run

samir-nasibli avatar Sep 02 '24 08:09 samir-nasibli

/intelci: run

samir-nasibli avatar Sep 02 '24 10:09 samir-nasibli

Last CI run: http://intel-ci.intel.com/ef691edb-824e-f15b-993d-a4bf010d0e2e

samir-nasibli avatar Sep 02 '24 11:09 samir-nasibli

@mergify backport rls/2024.7.0-rls

samir-nasibli avatar Sep 02 '24 13:09 samir-nasibli

backport rls/2024.7.0-rls

✅ Backports have been created

mergify[bot] avatar Sep 02 '24 13:09 mergify[bot]