generate a new (complex) Attribute

SimonW18272SimonW18272 Member Posts: 13 Newbie
Hey everyone,

I want to get a new attribute which is quiet complicated (atleast I think its the case)

I got the follwoing table with the data set in black and I want to get a new variable which indicates if the last case (look at date) with the same ID was a yes or no.

Imagine the data would be if a person (ID) came to the doctors appionted was noted. Now I want to generate an attribute if the person (ID) came to the last  appointment (before this one)or not. How can I enable this in Rapidminer because its quiet complex for me. Hope you get my question with the example


Answers

  • MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,503 RM Data Scientist
    Hi,
    seems like you can first use lag and then something like:
    if(date_before(Date-1,Date),"Yes,"No")
    with generate attributes
    or so?

    Best,
    Martin
    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • BalazsBaranyBalazsBarany Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert Posts: 955 Unicorn
    Simple lag won't be enough if multiple patients are in the data. The right approach would be "Loop values" on the ID (or better a nominal copy of it for Loop Values), inside the loop filtering for the current ID, and doing the lag there. 
  • MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University Professor Posts: 3,503 RM Data Scientist
    Oh, true.
    I usually recommend to use Group Into Collection + Loop Collection over Loop Values for this though.

    BR,
    Martin
    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
Sign In or Register to comment.