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

Skip to content

Conversation

@srajanpaliwal
Copy link
Contributor

@srajanpaliwal srajanpaliwal commented Jan 1, 2018

Reference Issues/PRs
Fixes #10113

What does this implement/fix? Explain your changes.
I implemented changes mentioned in the comment thread.

  • Changed predict_proba, so that it checks the after-fitting estimator. i.e it checks self.estimators_[0] instead of self.estimator.
  • Added predict_proba as a property in MultiOutputClassifier class which makes its implementation similar to other classifiers.

…log or modified_huber loss) (scikit-learn#10113)

	- Changed predict_proba so that it checks the after-fitting estimator.
	- Added predict_proba as a property in MultiOutputClassifier
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.

Please add a test. Also change the PR title to reflect that this is not about SGDClassifier.

def _predict_proba(self, X):
check_is_fitted(self, 'estimators_')
if not hasattr(self.estimator, "predict_proba"):
if not hasattr(self.estimators_[0], "predict_proba"):
Copy link
Member

Choose a reason for hiding this comment

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

These checks belong in the property definition for it to work.

@amueller
Copy link
Member

amueller commented Jun 2, 2018

Are you still working on this?

@amueller
Copy link
Member

amueller commented Aug 5, 2019

fixed in #12222.

@amueller amueller closed this Aug 5, 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.

SGDClassifier never has the attribute "predict_proba" (even with log or modified_huber loss)

3 participants