The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here

Count the total of a specific value per Example

571131571131 Member Posts: 1 Learner I
edited December 2018 in Help

Hi,

 

I'm a Dutch student and have to work with Rapidminer, but can't figure something out.

I have a list of 140 restaurants. The restaurants have an option to provide a certain or multiple diets. There are 7 types of a diet they can provide (dairy-free/vegan/halal etc.). The values are shown as : 'True' or 'False'.

 

So this is how it looks:

Restaurant           Diet 1           Diet 2           Diet 3           Diet 4          ................................................etc

1                          True             False           False            False

2                          False            True            False            True

3                          False            False           True             False

4                          True             False           True             True

etc.

 

I would like to add a new attribute to show the total count of the value 'True'. In this way we know how many diets each restaurant can provide.

Restaurant           Diet 1           Diet 2           Diet 3           Diet 4          Total count of diets

1                          True             False           False            False                        1

2                          False            True            False            True                         2

3                          False            False           True             False                        1

4                          True             False           True             True                          3

 

I don't have the full knowledge when it comes to Rapidminer. Can someone please show me an easy way to add this new attribute?

 

Thanks in advance.

Answers

  • BalazsBaranyBalazsBarany Administrator, Moderator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert Posts: 955 Unicorn

    Hi!

     

    Use Map to change True to 1, False to 0.

    Then Parse Numbers, and Generate Aggregation over the sum of the line.

    Them map back the values to True and False if you need them in the original form.

     

    Regards,

    Balázs

  • kypexinkypexin RapidMiner Certified Analyst, Member Posts: 291 Unicorn

    I would add that a practice of encoding logical binary as 1/0 instead of True/False should always be considered a standard, and have helped in so many situations like calculating sums, ratios, aggregations etc, be it RapidMiner, Excel or anything else tool for analysis. At some point has become my 'must do' rule.

Sign In or Register to comment.