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
(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, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,533 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