<< GetPlaceOnSOM CLUSTER GetXieBeniIndex >>

CLUSTER >> CLUSTER > GetQuantizationError

GetQuantizationError

calculates the sum of distances between sample vectors and cluster centers.

Calling Sequence

[QuantizationError] = GetQuantizationError(Samples, Centers, NormType)

Parameters

Samples:

matrix that includes sample vectors as rows

Centers:

matrix that includes cluster centers as rows

NormType:

norm of vectors, must be a scalar greater than zeros, can be %inf

QuantizationError:

sum of distances between sample vectors and cluster centers

Description

For each row vector of Samples the nearest neighbor among the row vectors of Centers is searched and the distance is calculated. The sum of distances is returned.

Examples

global CLUSTER_PATH;
Source = read_csv(CLUSTER_PATH + 'demos\IrisData.csv', ascii(9));
Samples = strtod(Source(:, 1 : 4));
InitialCenters = SelectRandomly(Samples, 5);
Centers = CMeans(Samples, InitialCenters, 2, 'iterations', 10);
QuantizationError = GetQuantizationError(Samples, Centers, 2)

See also

Authors

Bibliography

Richard O. Duda, Peter E. Hart, David G. Stork, 'Pattern Classification', John Wiley & Sons Inc., New York, Chichester, Weinheim, Brisbane, Singapore, Toronto, Second Edition, 2001


Report an issue
<< GetPlaceOnSOM CLUSTER GetXieBeniIndex >>