🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

How to create dummy variable intervals, such as for times?

User: "mcmorri7"
New Altair Community Member
Updated by Jocelyn
I am trying to use the nominal to numerical operator to create dummy variables. One of the attributes I want to convert is time (e.g. 12:30), but there are over 600 different times in the attribute data. I would like to assign each time data to an hour interval. Such as, all times from 7:00-7:59 would convert to a single dummy variable. Is there a way to have RapidMiner do this? Thank you for your help.

Find more posts tagged with

Sort by:
1 - 2 of 21
    You may use Day to Nominal if your attribute is identified as a day-time attribute. 
    With it you can extract only the Hour of your data and use it as a new attribute.

    User: "kypexin"
    New Altair Community Member
    Hi @mcmorri7
    all times from 7:00-7:59 would convert to a single dummy variable
    Do you actually want to convert this interval to, say, '7' regardless of the day? Or it should count different days also, like Feb 13 7:00 - 7:59 and Feb 14 7:00 - 7:59 should be counted as different time periods?

    If you don't want to distinguish between dates and only need time of day, simple way to do that is to use GENERATE ATTRIBUTES operator, create a new attribute called 'hour' and use an expression like date_get(date, DATE_UNIT_HOUR), which will generate corresponding hour variable. 

    In the second case it would be done in a different way. I'd suggest that you use DATE TO NUMERICAL to convert dates to milliseconds elapsed since 1970, then divide that by 1000*60*60 and round the result to get an absolute hour value.

    Hope this helps.