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

Speed issues #4

Closed
JamesOwers opened this issue Aug 11, 2015 · 1 comment
Closed

Speed issues #4

JamesOwers opened this issue Aug 11, 2015 · 1 comment

Comments

@JamesOwers
Copy link

Apologies for vague issue, I've not much time, I noticed that I got a speedup by converting my cluster centroids to integers. Granted my categories are integers and not strings, but you may be able to use np.unique() to swap out strings for integers.

To test this try generating a large matrix of integer classes (for me this was 70,000 rows by 20 columns with each column having 4 classes i.e. numbers 1 to 4) and running the following:

_labels_cost(X, np.uint8(km.cluster_centroids_))

vs.

_labels_cost(X, km.cluster_centroids_)
@nicodv
Copy link
Owner

nicodv commented Feb 27, 2016

Thanks, that's a great idea!

Implemented in 5457e56, could give a huge speed boost to people using big strings in X.

@nicodv nicodv closed this as completed Feb 27, 2016
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

No branches or pull requests

2 participants