A first prototype for the space of sequences

Former-commit-id: 07dc6ef044b5b6a6fb45dc2acb01dffe71a96195
This commit is contained in:
2023-08-27 14:58:55 +02:00
parent cbd42d5b30
commit 9bf006af93
17 changed files with 969 additions and 117 deletions

View File

@ -74,8 +74,7 @@ func AssignToClass(data, centers *obiutils.Matrix[float64]) []int {
// Returns:
// - centers: a pointer to a matrix of float64 values representing the centers of the clusters.
func ComputeCenters(data *obiutils.Matrix[float64], k int, classes []int) *obiutils.Matrix[float64] {
centers := obiutils.Make2DArray[float64](k, len((*data)[0]))
centers.Init(0.0)
centers := obiutils.Make2DNumericArray[float64](k, len((*data)[0]), true)
ns := make([]int, k)
var wg sync.WaitGroup