Listing all different values for an attribute

alexmanalexman Member Posts: 9 Contributor II
edited November 2018 in Help
Hi,

I would like to be able to list all the different values for an attribute. For example:

City
L.A
L.A
L.A
Boston
Cleveland
New York
Rapidminer GUI output would be in range column: L.A (3) Boston(1) Cleveland(1) New york(1)
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

Answers

  • landland RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 2,525   Unicorn
    Hi, there's a simple method for this:

    Attribute at = null;
    List<String> values = at.getMapping().getValues();
    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.

    Greetings,
      Sebastian
Sign In or Register to comment.