|
KMeansClusterCollectionDistortion Method
|
Calculates the average square distance from the data points
to the nearest clusters' centroids.
Namespace:
Accord.MachineLearning
Assembly:
Accord.MachineLearning (in Accord.MachineLearning.dll) Version: 3.8.0
Syntax public double Distortion(
double[][] data,
int[] labels = null,
double[] weights = null
)
Public Function Distortion (
data As Double()(),
Optional labels As Integer() = Nothing,
Optional weights As Double() = Nothing
) As Double
Request Example
View SourceParameters
- data
- Type: SystemDouble
The data. - labels (Optional)
- Type: SystemInt32
The labels. - weights (Optional)
- Type: SystemDouble
The weights.
Return Value
Type:
DoubleThe average square distance from the data points to the nearest
clusters' centroids.
Implements
ICentroidClusterCollectionTData, TCentroids, TClusterDistortion(TData, Int32, Double)Remarks The average distance from centroids can be used as a measure
of the "goodness" of the clustering. The more the data are
aggregated around the centroids, the less the average distance.
See Also