K-Means clustering algorithm
OperationsCode 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();
}
K-Means group clustering
function : native : Group(group_labels:String[], records:Vector<FloatArrayRef>, record_length:Int, min_value:Float, max_value:Float) ~ KMeansGrouping
Name | Type | Description |
---|---|---|
group_labels | String[] | group labels used to tag groups also specify K |
records | Vector<FloatArrayRef> | input records |
record_length | Int | length of records, all records lengths be the same |
min_value | Float | smallest record value |
max_value | Float | largest record value |
Type | Description |
---|---|
KMeansGrouping | labeled grouping |