Skip to content

Improve sklearnex relative perf in sklearn_example.json#209

Open
ethanglaser wants to merge 2 commits intoIntelPython:mainfrom
ethanglaser:dev/eglaser-fix-sklearn-example
Open

Improve sklearnex relative perf in sklearn_example.json#209
ethanglaser wants to merge 2 commits intoIntelPython:mainfrom
ethanglaser:dev/eglaser-fix-sklearn-example

Conversation

@ethanglaser
Copy link
Copy Markdown
Contributor

@ethanglaser ethanglaser commented Apr 23, 2026

Description

Before:
image

After:
image


Checklist:

Completeness and readability

  • 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 updates 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 resolved any merge conflicts that might occur with the base branch.

Testing

  • I have run it locally and tested the changes extensively.
  • All CI jobs are green or I have provided justification why they aren't.
  • I have extended testing suite if new functionality was introduced in this PR.

"centers": 2,
"n_samples": 1000,
"n_samples": 5000,
"n_features": [16, 64]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we need the case with 16 features?

Copy link
Copy Markdown
Contributor Author

@ethanglaser ethanglaser Apr 24, 2026

Choose a reason for hiding this comment

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

I think this may have been originally added to demonstrate to users that configs can take lists instead of just individual values - so I'd be in favor of keeping it as is

Comment thread configs/sklearn_example.json Outdated
Comment thread configs/sklearn_example.json
Comment thread configs/sklearn_example.json
@ethanglaser
Copy link
Copy Markdown
Contributor Author

@avolkov-intel with this diff:
image
I get this result:
image

Seems like kd_tree does have better speedup for predict, but poor for fit (which matters for kd_tree) - for brute there is negligible compute happening in fit so that being red is not really a problem, therefore I am not sure kd_tree is better overall. LinReg predict is marginally better - I think it may be tough to get significant speedups here. And as for kmeans, I think part of the example config is to show off different features of the config, one of which is ignoring like it has currently - so we can add it or not.

@ethanglaser ethanglaser reopened this Apr 24, 2026
@avolkov-intel
Copy link
Copy Markdown
Collaborator

@avolkov-intel with this diff: image I get this result: image

Seems like kd_tree does have better speedup for predict, but poor for fit (which matters for kd_tree) - for brute there is negligible compute happening in fit so that being red is not really a problem, therefore I am not sure kd_tree is better overall. LinReg predict is marginally better - I think it may be tough to get significant speedups here. And as for kmeans, I think part of the example config is to show off different features of the config, one of which is ignoring like it has currently - so we can add it or not.

I guess let's keep kd_tree for KNN and ignore the rest of the suggestions

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