Skip to content

Simplify estimate gaussian covariances diag - #30414

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

OmarManzoor merged 2 commits into
scikit-learn:mainfrom
ogrisel:simplify-_estimate_gaussian_covariances_diag

Conversation

@ogrisel

@ogrisel ogrisel commented Dec 5, 2024

Copy link
Copy Markdown
Member

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

github-actions Bot commented Dec 5, 2024 •

Copy link
Copy Markdown

✔️ Linting Passed

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

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

@jeremiedbb jeremiedbb left a comment

Copy link
Copy Markdown
Member

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

ogrisel commented Dec 5, 2024

Copy link
Copy Markdown
Member Author

@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

mekleo commented Dec 5, 2024

Copy link
Copy Markdown
Contributor

@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.

@OmarManzoor OmarManzoor left a comment

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.

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
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