Listing all different values for an attribute

alexman
New Altair Community Member
Hi,
I would like to be able to list all the different values for an attribute. For example:
to get the number of times that L.A appears I can use Statistics.Count but I need to have the city name values isolated (L.A, Boston Cleveland, and New York)
I need to do it with rapidminer API ... is there any function like .... List l = Attribute.getDifferentValues() ?
Thx a lot
I would like to be able to list all the different values for an attribute. For example:
Rapidminer GUI output would be in range column: L.A (3) Boston(1) Cleveland(1) New york(1)
City
L.A
L.A
L.A
Boston
Cleveland
New York
to get the number of times that L.A appears I can use Statistics.Count but I need to have the city name values isolated (L.A, Boston Cleveland, and New York)
I need to do it with rapidminer API ... is there any function like .... List l = Attribute.getDifferentValues() ?
Thx a lot
Tagged:
0
Answers
-
Hi, there's a simple method for this:
But keep in mind, that you will recieve every value known so far. It might be, that this value isn't contained in the actual data set you have. So some of the values might have count of 0.
Attribute at = null;
List<String> values = at.getMapping().getValues();
Greetings,
Sebastian
0