Closed ydarma closed 4 years ago
Implementation is trivial : in algo.go
:
func (algo *Algo) Predict(elemt Elemt) (pred Elemt, label int, dist float64, err error) {
var clust Clust
clust, err = algo.Centroids()
if err == nil {
pred, label, dist = clust.Assign(elemt, algo.space)
}
return
}
In OnlineClust interface, the Predict function should return also the distance to the nearest cluster. This information could be useful to the user.
should become