Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

DOC document and deprecate missing attributes in MiniBatchKMeans #17864

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

jeremiedbb
Copy link
Member

@jeremiedbb jeremiedbb commented Jul 8, 2020

Part of #14312

counts_ and init_size_ are not documented as MiniBatchKMeans attributes.
They are not useful for the user so I propose to deprecate them.

random_state_ is only created and used in partial_fit. I think it's safe to directly privatize it. What do you think ?

Extracted from #17622 to facilitate the reviews.

ping @glemaitre

@glemaitre
Copy link
Member

Could you add an entry in what's new to mention that we deprecate these attributes (this is more interesting than the documentation actually). Otherwise LGTM

@jeremiedbb
Copy link
Member Author

jeremiedbb commented Jul 10, 2020

There was also n_iter_ that was not documented. No deprecation for this one, it's useful. Now I can remove MiniBatchKMeans from the blacklist of test_docstring_fit_attributes

Comment on lines 235 to 238
IGNORED = {'BayesianRidge', 'Birch', 'CCA',
'LarsCV', 'Lasso', 'LassoLarsCV', 'LassoLarsIC',
'OrthogonalMatchingPursuit',
'PLSCanonical', 'PLSSVD',
'PassiveAggressiveClassifier'}
'PLSCanonical', 'PLSSVD'}
Copy link
Member Author

Choose a reason for hiding this comment

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

I found that 3 other estimators pass the test. We forgot to remove them from the blacklist in the dedicated doc PRs

@rth
Copy link
Member

rth commented Jul 10, 2020

Thanks! Generally looks good, there are some test failures however.

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

Just one question but LGTM, thanks @jeremiedbb

@@ -1831,7 +1857,7 @@ def partial_fit(self, X, y=None, sample_weight=None):
order='C', accept_large_sparse=False,
reset=is_first_call_to_partial_fit)

self.random_state_ = getattr(self, "random_state_",
self._random_state = getattr(self, "_random_state",
Copy link
Member

Choose a reason for hiding this comment

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

Do we also need to deprecate this one, or was it a typo / random_state_ never existed?

Copy link
Member Author

Choose a reason for hiding this comment

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

I wasn't sure what to do about this one. In the PR descr I asked

random_state_ is only created and used in partial_fit. I think it's safe to directly privatize it. What do you think ?

Copy link
Member

Choose a reason for hiding this comment

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

missed that, sorry. If it's only a matter of having a @Property it wouldn't hurt to deprecate (no need to document it though). If it's a pain, I agree there's little risk in just ignoring this. Up to you, feel free to self merge

Copy link
Member Author

Choose a reason for hiding this comment

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

Let's deprecate it as well

@jeremiedbb jeremiedbb merged commit 5d2107e into scikit-learn:master Jul 12, 2020
jayzed82 pushed a commit to jayzed82/scikit-learn that referenced this pull request Oct 22, 2020
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.