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

Skip to content

[MRG+1] Refactor birch-documentation - #8298

Merged
MechCoder merged 4 commits into
scikit-learn:masterfrom
MechCoder:refactor_birch
Feb 7, 2017
Merged

[MRG+1] Refactor birch-documentation#8298
MechCoder merged 4 commits into
scikit-learn:masterfrom
MechCoder:refactor_birch

Conversation

@MechCoder

Copy link
Copy Markdown
Member

What does this implement/fix? Explain your changes.

This refactors a bit of Birch Documentation.

Comment thread sklearn/cluster/birch.py Outdated
For a new point entering the root, it is merged with the subcluster closest
to it and the linear sum, squared sum and the number of samples of that
subcluster are updated. This is done recursively till the properties of
the leaf node are updated.

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.

The guidelines for docstrings is that the text before the parameters should be short. The reason is that users might not realize that parameters are described after.

I think that the right thing would be to move part of the text that you added in the "notes" section.

@MechCoder

Copy link
Copy Markdown
Member Author

Done, thanks!

@jnothman jnothman left a comment

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.

otherwise LGTM

Comment thread sklearn/cluster/birch.py Outdated
centroid closest to the new sample. This is done recursively till it
ends up at the subcluster of the leaf of the tree has the closest centroid.
It is a memory-efficient, online-learning algorithm provided as an alternative
to MiniBatchKMeans. It constructs a tree data-structure with the cluster

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.

use :class:?

Comment thread sklearn/cluster/birch.py Outdated
to MiniBatchKMeans. It constructs a tree data-structure with the cluster
centroids being read off the leaf. These can be either the final cluster
centroids or can be provided as input to another clustering algorithm
such as `AgglomerativeClustering`.

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.

use :class:?

Comment thread sklearn/cluster/birch.py Outdated
The radius of the subcluster obtained by merging a new sample and the
closest subcluster should be lesser than the threshold. Otherwise a new
subcluster is started.
subcluster is started. Setting this value to be very low, promotes

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.

remove ,

Comment thread sklearn/cluster/birch.py Outdated
fit is AgglomerativeClustering with n_clusters set to the int.
subclusters from the leaves as new samples.

"None" : the final clustering step is not performed and the subclusters are

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 don't think we should be using quotes for non-string values. Use double-backticks if you wish.

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.

Also, I'd rather this be formatted using RST's list syntax (either bullet or definition) rather than individual paragraphs.

Comment thread sklearn/cluster/birch.py Outdated

Notes
-----
The tree data-structure consists of nodes with each node consisting of

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.

drop hyphen

@GaelVaroquaux GaelVaroquaux changed the title [MRG] Refactor birch-documentation [MRG+1] Refactor birch-documentation Feb 6, 2017
@GaelVaroquaux

Copy link
Copy Markdown
Member

+1 on my side: this is a net improvement of what we have.

@jnothman

jnothman commented Feb 6, 2017

Copy link
Copy Markdown
Member

If you have a moment to fix my comments, please do so and merge.

@MechCoder

Copy link
Copy Markdown
Member Author

Thanks! I am embarrassed to admit that after looking at the documentation after a long time and I wasn't sure what was going on till I went through the code again.

@MechCoder
MechCoder merged commit 42562e1 into scikit-learn:master Feb 7, 2017
@MechCoder
MechCoder deleted the refactor_birch branch February 7, 2017 04:55
sergeyf pushed a commit to sergeyf/scikit-learn that referenced this pull request Feb 28, 2017
* Refactor birch-documentation

* move

* class tags

* pep8
@Przemo10 Przemo10 mentioned this pull request Mar 17, 2017
Sundrique pushed a commit to Sundrique/scikit-learn that referenced this pull request Jun 14, 2017
* Refactor birch-documentation

* move

* class tags

* pep8
NelleV pushed a commit to NelleV/scikit-learn that referenced this pull request Aug 11, 2017
* Refactor birch-documentation

* move

* class tags

* pep8
paulha pushed a commit to paulha/scikit-learn that referenced this pull request Aug 19, 2017
* Refactor birch-documentation

* move

* class tags

* pep8
maskani-moh pushed a commit to maskani-moh/scikit-learn that referenced this pull request Nov 15, 2017
* Refactor birch-documentation

* move

* class tags

* pep8
lemonlaug pushed a commit to lemonlaug/scikit-learn that referenced this pull request Jan 6, 2021
* Refactor birch-documentation

* move

* class tags

* pep8
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.

3 participants