Skip to content
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

Adds a better method for accessing the centroids of a KMeansModel #98

Merged
merged 4 commits into from
Nov 30, 2020

Conversation

Craigacp
Copy link
Member

Description

Adds KMeansModel.getCentroids which returns a List<List<Feature>>. The old getCentroidVectors method requires the user to do the mapping from internal feature indices to feature names themselves, and the indices should never be required to use the library. I've updated the clustering tutorial to use the new method and also the K-Means++ initialisation added after the 4.0 release.

Motivation

Adds the new centroid accessor. It also fixes a compatibility bug as KMeansTrainer had it's constructor changed in a backwards incompatible way, so a constructor with the correct signature was added.

This is an improvement discussed in #72.

Copy link
Member

@jhalexand jhalexand left a comment

Choose a reason for hiding this comment

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

Looks good.

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