Converting nominal to numeric

Legacy UserLegacy User MemberPosts:0Newbie
edited October 2019 inHelp
I am very new to RapidMinder, and I need to convert a lot of nominal attributes to numeric. I tried Nominal2Numerical in operator in RapidMiner 4.4 hoping it would do dichotomization - but it does not, instead it seems to be doing the conversion to equidistant real numbers which does not seem to make much sense, at least in my case.

Eventually, I figured out how to do dichotomization "manually" by using ConditionedFeatureGeneration, but it gets tedious since I have to create an separate operator for each value of each attribute, and there're many.

For nominals with many possible values, I figured out how to convert them to target frequencies using ValueIterator and macros, but again it seems like I might be missing a much simpler solution.

I will appreaciate any advice!

Thanks,
~Alexei
Tagged:

Answers

  • haddockhaddock MemberPosts:849Maven
    Greetings Alexei,

    I think you can avoid all that horrible re-typing by using variables, or as they are termed in RM "macros". Here's what I mean...

    Good luck, and good weekend!




















  • abetin71abetin71 MemberPosts:1Contributor I
    Thanks! Your reply started me on the iterators path, and since I'm actually trying to dichotomize my nominals, I came up with what seemed a very nice construct below.

    Problem is, it adds the correct attribute at each iteratation, but does not keep it around for the next iteration. No matter if "work_on_input" is true or false, at the very end of the process, I end up with the original unmodified ExampleSource.

    I guess I could rename my attributes so I can apply your suggestion directly and get rid of FeatureIterator, but I am hoping that again, I may be missing something simple...

    Thanks,
    ~Alexei















  • haddockhaddock MemberPosts:849Maven
    Hi again,

    连续的“连接”可以是一个问题,除非你使用the IteratingOperatorChain, which keeps the output. There is an example of this at work athttp://rapid-i.com/rapidforum/index.php/topic,773.0.html.
  • TobiasMalbrechtTobiasMalbrecht Moderator, Employee, MemberPosts:294RM Product Management
    Hi Alexei,

    RapidMiner surely allows to find complicate solutions. Fortunately, there are often also simple ones.:)Just use the [tt]Nominal2Binominal[/tt] and a subsequent [tt]Nominal2Numerical[/tt] operator and you're done with the dichotomization.

    Kind regards,
    Tobias
  • cantabcantab MemberPosts:6Contributor II
    Nominal2binominal is good, but very slow when some nominal features have too many different values. How can I filter out (eliminate) features that have more than some number (e.g. 20) different nominal values?
  • IngoRMIngoRM Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, Community Manager, RMResearcher, Member, University ProfessorPosts:1,751RM Founder
    Phew, that's possible but a quite complex process (but it's possible):


























    <操作符名称= " Macro2Log " class = "Macro2Log">

















































    Cheers,
    Ingo
Sign InorRegisterto comment.