class

Stochasta::KMeans::Model

Inherits Reference < Object

Constructors

new(k : Int32, max_iter : Int32 = 300, tolerance : Float64 = 1e-4)
Source

Instance methods

assignments
Source
assignments=(assignments : Array(Int32))
Source
centroids
Source
centroids=(centroids : Array(Array(Float64)))
Source
fit(data : Array(Array(Float64))) : self

Fits the data and clusters them

Source
k=(k : Int32)
Source
max_iter
Source
max_iter=(max_iter : Int32)
Source
predict(point : Array(Float64)) : Int32

Predict the closest cluster for a new data point

Source
tolerance
Source
tolerance=(tolerance : Float64)
Source