ott.tools.k_means.KMeansOutput#
- class ott.tools.k_means.KMeansOutput(centroids, assignment, converged, iteration, error, inner_errors)[source]#
Output of the
k_means()
algorithm.- Parameters:
centroids (Array) – Array of shape
[k, ndim]
containing the centroids.assignment (Array) – Array of shape
[n,]
containing the labels.converged (bool) – Whether the algorithm has converged.
iteration (int) – The number of iterations run.
error (float) – (Weighted) sum of squared distances from each point to its closest center.
inner_errors (Array | None) – Array of shape
[max_iterations,]
containing theerror
at every iteration.
Methods
count
(value, /)Return number of occurrences of value.
index
(value[, start, stop])Return first index of value.
Attributes
Alias for field number 1
Alias for field number 0
Alias for field number 2
Alias for field number 4
Alias for field number 5
Alias for field number 3