Skip to content

Instantly share code, notes, and snippets.

@kozo2
Last active March 9, 2019 17:06
Show Gist options
  • Save kozo2/60c48e1b9e0e79c16b98ba740850407a to your computer and use it in GitHub Desktop.
Save kozo2/60c48e1b9e0e79c16b98ba740850407a to your computer and use it in GitHub Desktop.
require "numo/narray"
require "rumale"
samples = Numo::DFloat[[1, 2], [1, 4], [1, 0],[10, 2], [10, 4], [10, 0]]
analyzer = Rumale::Clustering::KMeans.new(n_clusters: 2, max_iter: 50)
cluster_labels = analyzer.fit_predict(samples)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment