[SOLVED] classification of the values of the cluster attribute
imfaith
New Altair Community Member
Hi ,
I used this code to know for each data belongs to which cluster.
Best regards.
I used this code to know for each data belongs to which cluster.
it gave me the results as follows:
for (Example example : resultSet){
Attribute clusterAttribute = resultSet.getAttributes().getCluster();
double value = resultSet.getAttributes().getCluster().getValue(example.getDataRow());
System.out.println(value)
index corresponds to which cluster the data belongs in this rang. I am looking for the existance for other better solutions. what worries me is that I do not know at earlier classification of clusters. For example : the value of cluster attribute in my process is :
0.0 => i.e the data in this row belong to cluster_6 (see code below)
1.0 => i.e the data in this row belong to cluster_1
0.0
2.0 => i.e the data in this row belong to cluster_0
3.0
4.0
4.0
...
values = [cluster_6, cluster_1, cluster_0, cluster_4, cluster_2, cluster_3, cluster_5]I want it to be ordered by starting with the cluster_0 until to cluster_6. Hence the index 0.0 indicates cluster_0.
Best regards.
0
Answers
-
Even though it may be possible, we did not design a way to reorder the mapping of double values to strings. However, you can easily get the translation by using the nominal mapping:
String cluster = clusterAttribute.getNominalMapping().mapIndex(clusterAttribute.getValue(example.getDataRow()))
Best, Marius0 -
Thank you very much.0