Skip to content

MRG: Fix predict_proba w/ sparse matrix regression - #1141

Merged
larsmans merged 6 commits into
scikit-learn:masterfrom
pprett:sgd-predict-proba
Sep 14, 2012
Merged

larsmans merged 6 commits into
scikit-learn:masterfrom
pprett:sgd-predict-proba

Conversation

@pprett

@pprett pprett commented Sep 12, 2012

Copy link
Copy Markdown
Member

This PR fixes the SGDClassifier.predict_proba w/ sparse matrix regression.

The regression was introduced in #1030 and, thus, release 0.12 where I used len to get the number of rows of matrix X. Even thought predict_proba was covered by a number of tests, the test suite used a trick automatically test for dense and sparse inputs, however, predict_proba was not exposed to the sparse inputs.

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.

I would prefer:

"""Predict decision function values for each sample in X.

X is assumed to be either sparse matrix or array-like.

"""

Keeping the first line a oneliner makes for better integration in IDEs and other documentation tools. See Multiline Docstrings in PEP-257.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

changed - thx

@amueller

Copy link
Copy Markdown
Member

Came across this problem today. Thanks for the fix :)

@amueller

Copy link
Copy Markdown
Member

LGTM

@agramfort

Copy link
Copy Markdown
Member

LGTM

@pprett

pprett commented Sep 13, 2012

Copy link
Copy Markdown
Member Author

@larsmans good catch - thanks - I fixed the docstring

@amueller

Copy link
Copy Markdown
Member

Ok, again LGTM. Good thing @larsmans pays more attention then I do ;)

@larsmans

Copy link
Copy Markdown
Member

👍 for merging when the docstrings are fixed.

@amueller

Copy link
Copy Markdown
Member

@pprett Lol I thought today about changing my avatar to a photo ^^

larsmans added a commit that referenced this pull request Sep 14, 2012
Fix predict_proba w/ sparse matrix regression
@larsmans
larsmans merged commit 8aac72f into scikit-learn:master Sep 14, 2012
@pprett

pprett commented Sep 14, 2012

Copy link
Copy Markdown
Member Author

@larsmans thx for merging

@amueller makes coding more social ;-) - btw: why are you hiding behind that bush?

@amueller

Copy link
Copy Markdown
Member

Not any more I'm not ;)

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.

5 participants