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
Change Date-Time to Date only
Hi All, newbie here using 9.1.
I am working with data with date and time format. But then, I need to group the data by date regardless the time. But because the time is there, I can't use aggregate for that (or did I miss something?)
I notice that I can change the attribute type to date only, if I re-import the data from the original excel file. But I already process the data. It's kind of troublesome to redo all the process again starting from importing. Well, I notice that I can export then import again to change the date format.
But.. can I just change date format inside the rapidminer?
I am working with data with date and time format. But then, I need to group the data by date regardless the time. But because the time is there, I can't use aggregate for that (or did I miss something?)
I notice that I can change the attribute type to date only, if I re-import the data from the original excel file. But I already process the data. It's kind of troublesome to redo all the process again starting from importing. Well, I notice that I can export then import again to change the date format.
But.. can I just change date format inside the rapidminer?
Tagged:
0
Best Answers
-
yyhuang Administrator, Employee-RapidMiner, RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 364 RM Data ScientistHi @layung,
Please try the operator "date to nominal" and use your preferred date format, like yyyy/MM/dd, or yyyy-MM-dd, etc.<?xml version="1.0" encoding="UTF-8"?><process version="9.2.000"> <context> <input/> <output/> <macros/> </context> <operator activated="true" class="process" compatibility="9.2.000" expanded="true" name="Process"> <parameter key="logverbosity" value="init"/> <parameter key="random_seed" value="2001"/> <parameter key="send_mail" value="never"/> <parameter key="notification_email" value=""/> <parameter key="process_duration_for_mail" value="30"/> <parameter key="encoding" value="SYSTEM"/> <process expanded="true"> <operator activated="true" class="utility:create_exampleset" compatibility="9.2.000" expanded="true" height="68" name="Create ExampleSet" width="90" x="179" y="34"> <parameter key="generator_type" value="date series"/> <parameter key="number_of_examples" value="32"/> <parameter key="use_stepsize" value="false"/> <list key="function_descriptions"/> <parameter key="add_id_attribute" value="false"/> <list key="numeric_series_configuration"> <parameter key="date" value="linear.0\.0.1\.0"/> </list> <list key="date_series_configuration"> <parameter key="date" value="2019-01-01 00:00:00.2019-02-01 00:00:00"/> </list> <list key="date_series_configuration (interval)"/> <parameter key="date_format" value="yyyy-MM-dd HH:mm:ss"/> <parameter key="time_zone" value="SYSTEM"/> <parameter key="column_separator" value=","/> <parameter key="parse_all_as_nominal" value="false"/> <parameter key="decimal_point_character" value="."/> <parameter key="trim_attribute_names" value="true"/> </operator> <operator activated="true" class="date_to_nominal" compatibility="9.2.000" expanded="true" height="82" name="Date to Nominal" width="90" x="514" y="34"> <parameter key="attribute_name" value="date"/> <parameter key="date_format" value="yyyy-MM-dd"/> <parameter key="time_zone" value="SYSTEM"/> <parameter key="locale" value="English (United States)"/> <parameter key="keep_old_attribute" value="true"/> </operator> <connect from_op="Create ExampleSet" from_port="output" to_op="Date to Nominal" to_port="example set input"/> <connect from_op="Date to Nominal" from_port="example set output" to_port="result 1"/> <portSpacing port="source_input 1" spacing="0"/> <portSpacing port="sink_result 1" spacing="0"/> <portSpacing port="sink_result 2" spacing="0"/> </process> </operator> </process>
YY5 -
Telcontar120 RapidMiner Certified Analyst, RapidMiner Certified Expert, Member Posts: 1,635 UnicornThat solution works, and another option is to use the Date to Numerical and then select the level of date value that you want to aggregate by, either in terms of a periodic cycle or relative to a fixed point. The advantage of this method is that you can create multiple numericals corresponding to different levels of aggregation (e.g., you could have one for each day but then also one for each week or each month, etc.). Just FYI in case you need to do multiple date aggregations.0
Answers