func createNeigboursByIdx(indices []int) (neighbors knn.Neighbors) { for x, idx := range indices { row := tabula.Row{} for _, v := range dataFloat64[idx] { rec := tabula.NewRecordReal(v) row.PushBack(rec) } neighbors.Add(&row, float64(distances[x])) } return }
func createNeigbours() (neighbors knn.Neighbors) { for x, d := range dataFloat64 { row := tabula.Row{} for _, v := range d { rec := tabula.NewRecordReal(v) row.PushBack(rec) } neighbors.Add(&row, float64(distances[x])) } return }