Skip to content
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

FIX: incremental estimators tests #1998

Merged

Conversation

samir-nasibli
Copy link
Contributor

@samir-nasibli samir-nasibli commented Aug 11, 2024

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

  • I have reviewed my changes thoroughly before submitting this pull request.
  • 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.
  • Git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details).
  • I have added a respective label(s) to PR if I have a permission for that.
  • I have resolved any merge conflicts that might occur with the base branch.

Testing

  • The unit tests pass successfully.
  • 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
Copy link
Contributor Author

/intelci: run

@samir-nasibli
Copy link
Contributor Author

/intelci: run

Copy link
Contributor

@icfaust icfaust left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@samir-nasibli
Copy link
Contributor Author

samir-nasibli commented Aug 27, 2024

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.

@olegkkruglov
Copy link
Contributor

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

@samir-nasibli
Copy link
Contributor Author

/intelci: run

Copy link
Contributor

@olegkkruglov olegkkruglov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, assuming green CI

@samir-nasibli
Copy link
Contributor Author

/intelci: run

@samir-nasibli
Copy link
Contributor Author

@samir-nasibli samir-nasibli merged commit 4fd4568 into uxlfoundation:main Sep 2, 2024
23 checks passed
@samir-nasibli samir-nasibli deleted the fix/test_incremental branch September 2, 2024 13:11
@samir-nasibli
Copy link
Contributor Author

@mergify backport rls/2024.7.0-rls

Copy link

mergify bot commented Sep 2, 2024

backport rls/2024.7.0-rls

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Sep 2, 2024
* FIX: incremental  estimators tests

(cherry picked from commit 4fd4568)
samir-nasibli added a commit that referenced this pull request Sep 2, 2024
* FIX: incremental  estimators tests

(cherry picked from commit 4fd4568)

Co-authored-by: Samir Nasibli <[email protected]>
samir-nasibli added a commit to samir-nasibli/scikit-learn-intelex that referenced this pull request Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants