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
Nominal to date error in month conversion
Hello,
I'm trying to convert some nominal attributes containing dates in format like this "yyyymmdd" (for example: 20091205 for December 5, 2009). I used the nominal to date node specifying in the "date format" parameters the format of my data.
The node execute without errors and convert values in this format: "Jan 18, 2010".
However, day and year are correct but the month is always January, for ALL the values (but numbers are different of course).
I can't understand why, can someone help me with this?
Thank you in advance!
[Following my XML]
<?xml version="1.0" encoding="UTF-8"?><process version="7.6.001">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="7.6.001" expanded="true" name="Process">
<process expanded="true">
<operator activated="true" class="retrieve" compatibility="7.6.001" expanded="true" height="68" name="Retrieve final_dataset" width="90" x="45" y="136">
<parameter key="repository_entry" value="//Local Repository/data/final_dataset"/>
</operator>
<operator activated="true" class="select_attributes" compatibility="7.6.001" expanded="true" height="82" name="Select Attributes" width="90" x="179" y="136">
<parameter key="attribute_filter_type" value="subset"/>
<parameter key="attributes" value="COD_OPE|FIN_DTIA"/>
</operator>
<operator activated="true" class="nominal_to_date" compatibility="7.6.001" expanded="true" height="82" name="Nominal to Date" width="90" x="380" y="136">
<parameter key="attribute_name" value="FIN_DTIA"/>
<parameter key="date_format" value="yyyymmdd"/>
</operator>
<connect from_op="Retrieve final_dataset" from_port="output" to_op="Select Attributes" to_port="example set input"/>
<connect from_op="Select Attributes" from_port="example set output" to_op="Nominal to Date" to_port="example set input"/>
<connect from_op="Nominal to Date" from_port="example set output" to_port="result 1"/>
<connect from_op="Nominal to Date" from_port="original" to_port="result 2"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
<portSpacing port="sink_result 3" spacing="0"/>
</process>
</operator>
</process>
Tagged:
0
Answers
Hi @f_laperna,
More information regarding the available date format patterns can be found in the Help text of the respective Operator.
Either within RapidMiner Studio or on the website https://docs.rapidminer.com/studio/operators/blending/attributes/types/nominal_to_date.html.
Best regards,
Edin
Yeah, sure. This was certainly the reason why it read January for all the records.
But unfortunately now I get an error "Cannot parse date", but the date format is right.
EDIT: By changing the Time-zone and Locale I've been able to achieve what I wanted. So now it works. Thank you and sorry for the stupid question.
Are you sure date was read as 'polynominal' and not integer? If it was edit the dataset and change the attribute type to 'polynominal' and run the program again.