Skip to content

add links to KMeans++ examples in docstrings and the user guide#1

Closed
natmokval wants to merge 2 commits intomainfrom
plot_kmeans_plusplus
Closed

add links to KMeans++ examples in docstrings and the user guide#1
natmokval wants to merge 2 commits intomainfrom
plot_kmeans_plusplus

Conversation

@natmokval
Copy link
Copy Markdown
Owner

Towards scikit-learn#26927

added links to examples in the docstrings and the user guide for K-Means ++.

Copy link
Copy Markdown

@marenwestermann marenwestermann left a comment

Choose a reason for hiding this comment

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

Hi @natmokval! Thank you for your PR! I made just two small comments, otherwise it looks good.

K-means++ can also be called independently to select seeds for other
clustering algorithms, see :func:`sklearn.cluster.kmeans_plusplus` for details
and example usage.
K-means++ can also be called independently to select seeds for other clustering
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I would actually leave this as is because it's useful to users to have a direct link to the function documentation. I would instead add the example to the list of examples in the "Examples" section (beginning in line 244).

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

sorry for the late update, I did as you suggested. @marenwestermann thaks for your help.

For a comparison between K-Means and MiniBatchKMeans refer to example
:ref:`sphx_glr_auto_examples_cluster_plot_mini_batch_kmeans.py`.

For a demonstration of how K-Means can be used for generating initial seeds
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The idea of this example is to show how the function kmeans_plusplus can be called independently of a classifier. So I wouldn't link this example here. Given that the documentation for the kmeans_plusplus function is rather short and the example at the bottom of the documentation page can be found quite easily (see here), I would just remove this link here and not put it in the documentation of the function.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

thanks, done

@marenwestermann
Copy link
Copy Markdown

I'm just realising that this PR will merge your changes from your feature branch into the main branch of your fork. You want to change the main branch to the scikit-learn main branch. :)

@marenwestermann
Copy link
Copy Markdown

Hi @natmokval! Would you like to continue working on this PR? Let me know if you need help.

@natmokval
Copy link
Copy Markdown
Owner Author

I created a new PR for the corrected repo here scikit-learn#30126

@natmokval
Copy link
Copy Markdown
Owner Author

I'm just realising that this PR will merge your changes from your feature branch into the main branch of your fork. You want to change the main branch to the scikit-learn main branch. :)

sorry, my mistake. I opened a new PR and changed the main branch to the scikit-learn main branch

@natmokval
Copy link
Copy Markdown
Owner Author

Hi @natmokval! Would you like to continue working on this PR? Let me know if you need help.

yes, I would like to continue working on this. I updated my PR, could you please take a look at my changes here scikit-learn#30126?

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.

2 participants