Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.
(Poly)Nominal to Numeric: Keep Value
I do not want to recode nominal datatypes for coding in machine learning, but simply take the nominal value and convert it to it's numeric equivalent. I often do this in my teaching to show how if a data type is read incorrectly, we can convert it to a new type. From what I see, the options are more inline with converting for modeling purposes, which is great, but if Age, for example, comes in as polynominal, I dont want to recode the age of 21 to 0 given the range of values.
Simply, I want the Age to be converted to numeric 21, an age of 34 to be converted to numeric 34, etc.
Simply, I want the Age to be converted to numeric 21, an age of 34 to be converted to numeric 34, etc.
Tagged:
0
Best Answer
-
MartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,531 RM Data Scientist
Answers
I can think of two ways. One way is to try "Guess Type" operator. It re guesses the type of attribute. If guess types doesn't work, the other way is to use nominal to numerical operator. This doesn't change numerical values in the nominal attribute but changes attribute type to numerical.
Varun
https://www.varunmandalapu.com/
Be Safe. Follow precautions and Maintain Social Distancing
Guess Type kept things as Nominal, and Nominal to Numerical requires a coding type, all of which attempt to transform the data for modeling. In my case, all I need to do is retain the value but just change the type. Optionally, if I want the column to be numeric and the value can't be cast to numeric, have the data missing. In R, this is often done with as.numeric(), and is something easily done in point-and-click tools like Excel. The ability to cast for modeling is fantastic, but I am looking for something even more elementary.
Varun
https://www.varunmandalapu.com/
Be Safe. Follow precautions and Maintain Social Distancing