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
[SOLVED] Discretize by User Specification: multiple class problem
Hi everyone,
my question is about the operator "Discretize by User Specification" in order to discretize numerical values.
Let's assume I want to discretize the four cardinal directions (north, east, south and west) as follows:
315-45: North
45-135: East
135-225: South
225-315: West
and in RapidMiner (at least I assume) as follows:
now the problem is that the first "North" class will be overwritten with the second "North" class and the values appear as missing values "?".
Is there any workaround?
Cheers Q-Dog
my question is about the operator "Discretize by User Specification" in order to discretize numerical values.
Let's assume I want to discretize the four cardinal directions (north, east, south and west) as follows:
315-45: North
45-135: East
135-225: South
225-315: West
and in RapidMiner (at least I assume) as follows:
Is there any workaround?
Cheers Q-Dog
0
Answers
yes, this can indeed not be done with the operator "Discretize by User Specification" due to the "wrapping" for high degrees around "north". However, it is pretty simple with the operator "Generate Attributes" as in this example: Here, the generation parameter
if(degree>315||degree<45, "North", if(degree<135, "East", if(degree<225, "South", "West")))
has been used.
Another option would indeed use the modulo function '%' after adding the offset of 45 degrees:
if((degree+45)%360<90, "North", if((degree+45)%360<180, "East", if((degree+45)%360<270, "South", "West")))
By this, you could also transform angles higher than 360 degrees which might happen for measuring rotations etc.
Hope that helps,
Ingo