func (m *KMeans) _nearest(scaledRow mat.Vector) int {
	best := -1
	var bestDist float64
	for ic := 0; ic < m.NClusters; ic++ {
		d := m.Distance(scaledRow, m.Centroids.RowView(ic))
		if best < 0 || d < bestDist {
			best = ic
			bestDist = d
		}
	}
	return best
}
Nearest returns index of the nearest centroid
package cluster
import (
	"fmt"
	"runtime"
	"sync"
	"github.com/pa-m/sklearn/base"
	"gonum.org/v1/gonum/mat"
)
type KMeans struct {
	NClusters int
	NJobs    int
	Distance func(X, Y mat.Vector) float64
	Centroids *mat.Dense
}
func (m *KMeans) PredicterClone() base.Predicter {
	clone := *m
	return &clone
}
func (m *KMeans) IsClassifier() bool { return true }