// K-Means Algorithm with smart seeds
// as known as K-Means ++
K-Means Algorithm with smart seeds
as known as K-Means
// K - Means Algorithm with smart seeds // as known as K - Means ++
func Kmeans(rawData [][]float64, k int, distanceFunction DistanceFunction, threshold int) ([]int, error) {
	data := make([]ClusteredObservation, len(rawData))
	for ii, jj := range rawData {
		data[ii].Observation = jj
	}
	seeds := seed(data, k, distanceFunction)
	clusteredData, err := kmeans(data, seeds, distanceFunction, threshold)
	labels := make([]int, len(clusteredData))
	for ii, jj := range clusteredData {
		labels[ii] = jj.ClusterNumber
	}
	return labels, err
}
func Kmeans ( rawData [ ] [ ] float64 , k int , distanceFunction DistanceFunction , threshold int ) ( [ ] int , error ) { data := make ( [ ] ClusteredObservation , len ( rawData ) ) for ii , jj := range rawData { data [ ii ] . Observation = jj } seeds := seed ( data , k , distanceFunction ) clusteredData , err := kmeans ( data , seeds , distanceFunction , threshold ) labels := make ( [ ] int , len ( clusteredData ) ) for ii , jj := range clusteredData { labels [ ii ] = jj . ClusterNumber } return labels , err }
K-Means Algorithm with smart seeds
as known as K-Means
K - Means Algorithm with smart seeds as known as K - Means