Skip to content

Simplify estimate gaussian covariances diag#30414

Merged
OmarManzoor merged 2 commits intoscikit-learn:mainfrom
ogrisel:simplify-_estimate_gaussian_covariances_diag
Dec 6, 2024
Merged

Simplify estimate gaussian covariances diag#30414
OmarManzoor merged 2 commits intoscikit-learn:mainfrom
ogrisel:simplify-_estimate_gaussian_covariances_diag

Conversation

@ogrisel
Copy link
Copy Markdown
Member

@ogrisel ogrisel commented Dec 5, 2024

A quick efficiency improvement spotted by @mekleo in #30382.

I think this can go in independently of the decided resolution of the numerical stability problem reported in #30382.

@ogrisel ogrisel force-pushed the simplify-_estimate_gaussian_covariances_diag branch from 553fc3d to 67c180d Compare December 5, 2024 16:35
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 5, 2024

✔️ Linting Passed

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

Generated for commit: f31c5dd. Link to the linter CI: here

Copy link
Copy Markdown
Member

@jeremiedbb jeremiedbb left a comment

Choose a reason for hiding this comment

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

LGTM.

For future reviewers, the means arg receives means computed as means = np.dot(resp.T, X) / nk[:, np.newaxis], so avg_X_means is precisely means**2.

@jeremiedbb
Copy link
Copy Markdown
Member

Not sure it requires a changelog entry since it's internal detail but now that it's here.

@ogrisel ogrisel force-pushed the simplify-_estimate_gaussian_covariances_diag branch from 67c180d to f31c5dd Compare December 5, 2024 17:51
@ogrisel
Copy link
Copy Markdown
Member Author

ogrisel commented Dec 5, 2024

@mekleo I amended my commit to credit co-authorship (and similarly in the changelog entry). Please let us know if this is fine with you.

@mekleo
Copy link
Copy Markdown
Contributor

mekleo commented Dec 5, 2024

@mekleo I amended my commit to credit co-authorship (and similarly in the changelog entry). Please let us know if this is fine with you.

Great, thank you Olivier. Thanks, Jeremie for the speedy review.

Copy link
Copy Markdown
Contributor

@OmarManzoor OmarManzoor left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @mekleo and @ogrisel

@OmarManzoor OmarManzoor merged commit 507c432 into scikit-learn:main Dec 6, 2024
@ogrisel ogrisel deleted the simplify-_estimate_gaussian_covariances_diag branch December 6, 2024 14:42
virchan pushed a commit to virchan/scikit-learn that referenced this pull request Dec 9, 2024
Co-authored-by: mekleo <36504477+mekleo@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants