Skip to content

Fix inconsistent labels returned by BayesianGaussianMixture.fit_predict #12451

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

Merged

Conversation

ogrisel
Copy link
Member

@ogrisel ogrisel commented Oct 24, 2018

This is a fix for the issue reported in #12266. It includes a non-regression test to highlight the problem. I will add a changelog entry once the PR is open.

@amueller
Copy link
Member

is that also an issue for GaussianMixture?

@jeremiedbb
Copy link
Member

Probably since it inherits it's fit method from BaseMixture. But this fix is made in BaseMixture so it should fix both.

@ogrisel
Copy link
Member Author

ogrisel commented Oct 25, 2018

Probably since it inherits it's fit method from BaseMixture. But this fix is made in BaseMixture so it should fix both.

Indeed. I updated the relevant test and the changelog.

@TomDLT
Copy link
Member

TomDLT commented Oct 25, 2018

We should add the two models in the Changed models section of the what_new file.

Copy link
Member

@jnothman jnothman left a comment

Choose a reason for hiding this comment

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

Are we sure this change belongs in 0.20.1?

@ogrisel
Copy link
Member Author

ogrisel commented Oct 29, 2018

We should add the two models in the Changed models section of the what_new file.

There is not Changed models section for 0.20.1. I think that the change log for the bug fix release is short enough that such a section is not required in this case.

Are we sure this change belongs in 0.20.1?

It's not a regression fix but I believe it's a bug fix that can fix a potentially hard to understand annoying breakage of our fit_predict contract. So I am in favor of including it in 0.20.1 (although I don't think this bug impacts that many people).

@amueller
Copy link
Member

I'm ambivalent about 0.20.1. Maybe leaning towards including it?

@ogrisel
Copy link
Member Author

ogrisel commented Oct 31, 2018

I fixed the conflict.

@ogrisel
Copy link
Member Author

ogrisel commented Oct 31, 2018

The flake8 issue on travis seems like a false positive resulting from my last merge commit.

@lesteve if you ever wanted to consider a new edge case for your diff flake8 thingy ;)

@jnothman jnothman merged commit 036dfdd into scikit-learn:master Nov 3, 2018
@lesteve
Copy link
Member

lesteve commented Nov 5, 2018

@lesteve if you ever wanted to consider a new edge case for your diff flake8 thingy ;)

I can't see the false positive you are talking about, but maybe I am missing something ...

The error I see in the Travis flake8 failure:

Running flake8 on the diff in the range 1c88b3c9c..94347b3c8 (7 commit(s)):
--------------------------------------------------------------------------------
sklearn/mixture/tests/test_gaussian_mixture.py:13:1: F811 redefinition of unused 'pytest' from line 8
import pytest

Looking at the diff, it does look like you introduced a second "import pytest" (line 13) where there was already one on line 8.

thoo pushed a commit to thoo/scikit-learn that referenced this pull request Nov 14, 2018
jnothman pushed a commit to jnothman/scikit-learn that referenced this pull request Nov 14, 2018
jnothman pushed a commit to jnothman/scikit-learn that referenced this pull request Nov 14, 2018
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
xhluca pushed a commit to xhluca/scikit-learn that referenced this pull request Apr 28, 2019
koenvandevelde pushed a commit to koenvandevelde/scikit-learn that referenced this pull request Jul 12, 2019
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.

6 participants