The RapidMiner community is on read-only mode until further notice. Technical support via cases will continue to work as is. For any urgent licensing related requests from Students/Faculty members, please use the Altair academic forum here.
Getting day of the week out of a date
Hey together,
i´m trying to get the day of the week out of a date field. So, after i´m reading the example set, i use the operator "generate attributes".
<operator activated="true" breakpoints="before" class="generate_attributes" compatibility="5.1.000" expanded="true" height="76" name="Generate Attribute" width="90" x="581" y="30">
<list key="function_descriptions">
<parameter key="day_of_week" value="date_get(date, DATE_UNIT_DAY)"/>
</list>
</operator>
"use standard constants" is marked as well.
If i put a break bevor the generate attributes the Meta-output is as follows
Role Name Type Statistics Range Missings
regular date date length = 5 days [08.04.2011 ; 13.04.2011] 0
If i go on i get the following error:
May 9, 2011 4:55:26 PM SEVERE: Process failed: Generation exception: 'Error during evaluation: Invalid number of arguments for 'date_get', must be 2 or 4.
Is this a bug? or am i doing something wrong?
I´m using 2 arguments as you can see above. I also tried it with a different name instead of date i used date_old but with the same result.
i´m trying to get the day of the week out of a date field. So, after i´m reading the example set, i use the operator "generate attributes".
<operator activated="true" breakpoints="before" class="generate_attributes" compatibility="5.1.000" expanded="true" height="76" name="Generate Attribute" width="90" x="581" y="30">
<list key="function_descriptions">
<parameter key="day_of_week" value="date_get(date, DATE_UNIT_DAY)"/>
</list>
</operator>
"use standard constants" is marked as well.
If i put a break bevor the generate attributes the Meta-output is as follows
Role Name Type Statistics Range Missings
regular date date length = 5 days [08.04.2011 ; 13.04.2011] 0
If i go on i get the following error:
May 9, 2011 4:55:26 PM SEVERE: Process failed: Generation exception: 'Error during evaluation: Invalid number of arguments for 'date_get', must be 2 or 4.
Is this a bug? or am i doing something wrong?
I´m using 2 arguments as you can see above. I also tried it with a different name instead of date i used date_old but with the same result.
0
Answers
well, I tried it myself and it worked fine for me. Which version of RapidMiner do you use?
However, getting DATE_UNIT_DAY will only deliver the day of month anyway but you are asking for day of week, right? For this purpose, the operator "Date to Numerical" is the best option. See the example below.
Cheers,
Ingo
yes you are absolutly right, this is what i need :-)
Now it works and i got the day_of_week thanks again
Still the other transformation doesn´t work. I´m using RapidMiner 5.1.000
Greetings
that was a bug which has already been fixed. I suggest updating RapidMiner to the latest version.
Regards,
Marco