All Bundles

KMeans

K-Means clustering algorithm

Operations

Code example:

records->AddBack(FloatArrayRef->New([9.677901811, 3.044481052]));
records->AddBack(FloatArrayRef->New([2.103293937, 2.446154204]));
records->AddBack(FloatArrayRef->New([9.340432657, 2.896683906]));
records->AddBack(FloatArrayRef->New([7.674354483, 4.765027229]));
records->AddBack(FloatArrayRef->New([8.656404515, 0.481807722]));
# ...

labels := ["group-a","group-b", "group-c"];
groups := KMeans->Group(labels, records, 2, 0.0, 10.0);
groups->GetGroupNames()->ToString()->PrintLine();

groups->GetDunnIndex()->PrintLine();

each(group in groups) {
  group->GetName()->PrintLine();
  group->GetArrayValue(0)->PrintLine();
}

Group

K-Means group clustering

function : native : Group(group_labels:String[], records:Vector<FloatArrayRef>, record_length:Int, min_value:Float, max_value:Float) ~ KMeansGrouping
Parameters
NameTypeDescription
group_labelsString[]group labels used to tag groups also specify K
recordsVector<FloatArrayRef>input records
record_lengthIntlength of records, all records lengths be the same
min_valueFloatsmallest record value
max_valueFloatlargest record value

Return
TypeDescription
KMeansGroupinglabeled grouping