Compact clustering evaluation object
c = compact(eva)
c = compact(eva) returns a compact clustering evaluation object, which contains a subset of information about the clustering solution in eva. Compacting a clustering evaluation object reduces the memory requirements of the object, which is useful when clustering a large data set.
Compact clustering evaluation object, returned as a clustering evaluation object. The compact object includes the clustering evaluation results, In the compact object, the properties for the input data X, optimal clustering solution OptimalY, and the list of excluded data Missing are empty.
Create a compact clustering evaluation object from a full clustering evaluation object.
Load the sample data.
The data contains length and width measurements from the sepals and petals of three species of iris flowers.
Create a clustering evaluation object. Cluster the data using kmeans, and evaluate the optimal number of clusters using the gap criterion.
rng('default'); % For reproducibility eva = evalclusters(meas,'kmeans','Gap','KList',[1:6])
eva = GapEvaluation with properties: NumObservations: 150 InspectecedK: [1 2 3 4 5 6] CriterionValues: [0.0747 0.5906 0.8737 1.0055 1.0466 0.9848] OptimalK: 4
Create a compact clustering evaluation object from eva.
c = compact(eva)
c = GapEvaluation with properties: NumObservations: 150 InspectecedK: [1 2 3 4 5 6] CriterionValues: [0.0747 0.5906 0.8737 1.0055 1.0466 0.9848] OptimalK: 4
The displayed output of the compact object c is the same as the original object eva, but some properties not shown in the display are different. For example, in the compact object, the properties x, OptimalY, and Missing are empty.
Display the optimal clustering solution OptimalY for c.
ans =