Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@myenugula
Copy link
Contributor

@myenugula myenugula commented Mar 1, 2024

Reference Issues/PRs

Add new feature #28492

What does this implement/fix? Explain your changes.

The new feature adds the ability to store and access the list of lower bounds for each iteration in the BaseMixture class, providing insights into the convergence behavior of mixture models like GaussianMixture.

Any other comments?

Here's a code sample for using it on Iris dataset:

from sklearn import datasets
from sklearn.mixture import GaussianMixture
import matplotlib.pyplot as plt
import pandas as pd

iris = datasets.load_iris()
X = iris.data

d = pd.DataFrame(X)

gmm = GaussianMixture(n_components=3, n_init=10)
gmm.fit(d)

lower_bounds = gmm.lower_bounds_
n_iter = gmm.n_iter_

plt.figure(figsize=(10, 6))
plt.plot(range(1, n_iter + 1), lower_bounds, marker='o', linestyle='-')
plt.title('GMM Lower Bounds Across Iterations')
plt.xlabel('Iteration')
plt.ylabel('Lower Bound')
plt.grid(True)
plt.show()
image

@github-actions
Copy link

github-actions bot commented Mar 1, 2024

✔️ Linting Passed

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

Generated for commit: 15765a8. Link to the linter CI: here

@a-wozniakowski
Copy link

Great work! I was able to reproduce the results in the example. Similarly, I was able to generate results with BayesianGaussianMixture.

@myenugula
Copy link
Contributor Author

@a-wozniakowski Thank you so much for your review. I made changes accordingly and pushed the code.

@myenugula
Copy link
Contributor Author

@a-wozniakowski
Hope you're well! Could you please take a moment to review the PR after modification? Thanks a lot!

@myenugula myenugula requested a review from a-wozniakowski April 7, 2024 18:15
Copy link
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.

The changelog needs to move to 1.6. Otherwise LGTM. Thanks @myenugula

Comment on lines 133 to 136
- |Feature| Added the ability to store and access the list of lower bounds for
each iteration in the `BaseMixture` class, providing insights into the convergence
behavior of mixture models like `GaussianMixture`.
:pr:`28559` by :user:`Manideep Yenugula <myenugula>`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- |Feature| Added the ability to store and access the list of lower bounds for
each iteration in the `BaseMixture` class, providing insights into the convergence
behavior of mixture models like `GaussianMixture`.
:pr:`28559` by :user:`Manideep Yenugula <myenugula>`.
- |Feature| Added an attribute `lower_bounds_` in the :class:`mixture.BaseMixture`
class to save the list of lower bounds for each iteration thereby providing
insights into the convergence behaviour of mixture models like `GaussianMixture`.
:pr:`28559` by :user:`Manideep Yenugula <myenugula>`.

Copy link
Contributor

@antoinebaker antoinebaker Nov 7, 2024

Choose a reason for hiding this comment

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

As @adrinjalali mentioned, the changelog needs to removed from v1.5.rst and moved into its own entry 28559.feature.rst in the whats_new/upcoming_changes/sklearn.mixture folder. Otherwise LGTM too.

@OmarManzoor OmarManzoor added the Waiting for Second Reviewer First reviewer is done, need a second one! label Jun 27, 2024
@myenugula
Copy link
Contributor Author

any update on this?

@myenugula
Copy link
Contributor Author

Hi, Any update?

@OmarManzoor
Copy link
Contributor

@adrinjalali Could you maybe take a look here?

@adrinjalali
Copy link
Member

I don't think I can give a meaningful review here. Maybe @antoinebaker or @snath-xoc could have a look.

The changelog entry needs to be moved to its own file though: https://github.com/scikit-learn/scikit-learn/blob/main/doc/whats_new/upcoming_changes/README.md

Copy link
Contributor

@antoinebaker antoinebaker left a comment

Choose a reason for hiding this comment

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

Thanks @myenugula for the PR! LGTM overall after fixing the changelog.

@snath-xoc
Copy link
Contributor

Thanks @myenugula, looks good to me as well, will wait for the changelog modification

@myenugula
Copy link
Contributor Author

Hello any update ?

@antoinebaker
Copy link
Contributor

hello @myenugula, we are waiting for you to update the changelog, see
#28559 (comment)
#28559 (comment)

@myenugula myenugula force-pushed the GaussianMixture-lower_bounds branch from f707f71 to f5d3197 Compare March 26, 2025 21:16
Copy link
Contributor

@antoinebaker antoinebaker 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 @myenugula

Copy link
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 @myenugula

@OmarManzoor OmarManzoor merged commit 0dbbac9 into scikit-learn:main Mar 27, 2025
36 checks passed
lucyleeow pushed a commit to lucyleeow/scikit-learn that referenced this pull request Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:mixture Waiting for Second Reviewer First reviewer is done, need a second one!

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants