Method: Newral::Classifier::KMeansCluster#initialize
- Defined in:
- lib/newral/classifier/k_means_cluster.rb
#initialize(points, cluster_labels: [:a,:b], max_iterations: 20) ⇒ KMeansCluster
input array of points, cluster_labels: how many clusters to find, max_iterations stop after x approximations output hash of clusters where has keys are cluster_labels and value is points(Array) and center(point)
9 10 11 12 13 |
# File 'lib/newral/classifier/k_means_cluster.rb', line 9 def initialize( points, cluster_labels: [:a,:b], max_iterations: 20 ) @points = points @cluster_labels = cluster_labels @max_iterations = max_iterations end |