Due to recent updates, all users are required to create an Altair One account to login to the RapidMiner community. Click the Register button to create your account using the same email that you have previously used to login to the RapidMiner community. This will ensure that any previously created content will be synced to your Altair One account. Once you login, you will be asked to provide a username that identifies you to other Community users. Email us at Community with questions.

Date to Nominal Function

rowan_growan_g Member Posts: 47 Contributor II
edited June 2019 in Help
Hi,

Not sure if this has been requested. A Date-to-Nominal function for use in the Generate Attributes operator would be awesome!

Thanks for all the great work! Rapidminer is a fine piece of software! Keep it up1

Answers

  • Nils_WoehlerNils_Woehler Member Posts: 463 Maven
    Hi,

    there are already multiple possibilities to accomplish this.

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.3.009">
      <context>
        <input/>
        <output/>
        <macros/>
      </context>
      <operator activated="true" class="process" compatibility="5.3.009" expanded="true" name="Process">
        <process expanded="true">
          <operator activated="true" class="generate_data_user_specification" compatibility="5.3.009" expanded="true" height="60" name="Generate Data by User Specification" width="90" x="112" y="30">
            <list key="attribute_values">
              <parameter key="nominal_date" value="&quot;2007-08-09 12:37:56&quot;"/>
            </list>
            <list key="set_additional_roles"/>
          </operator>
          <operator activated="true" class="generate_attributes" compatibility="5.3.009" expanded="true" height="76" name="Generate Attributes (2)" width="90" x="246" y="30">
            <list key="function_descriptions">
              <parameter key="nominal_to_data_old" value="nominal_date"/>
            </list>
          </operator>
          <operator activated="true" class="nominal_to_date" compatibility="5.3.009" expanded="true" height="76" name="Nominal to Date" width="90" x="380" y="30">
            <parameter key="attribute_name" value="nominal_date"/>
            <parameter key="date_type" value="date_time"/>
            <parameter key="date_format" value="yyyy-MM-dd HH:mm:ss"/>
          </operator>
          <operator activated="true" class="generate_data_user_specification" compatibility="5.3.009" expanded="true" height="60" name="Generate Data by User Specification (2)" width="90" x="112" y="165">
            <list key="attribute_values">
              <parameter key="nominal_date" value="&quot;2007-08-09 12:37:56&quot;"/>
            </list>
            <list key="set_additional_roles"/>
          </operator>
          <operator activated="true" class="generate_attributes" compatibility="5.3.009" expanded="true" height="76" name="Generate Attributes" width="90" x="246" y="165">
            <list key="function_descriptions">
              <parameter key="date" value="date_parse_custom(nominal_date, &quot;yyyy-MM-dd HH:mm:ss&quot;, &quot;de&quot;)"/>
            </list>
          </operator>
          <connect from_op="Generate Data by User Specification" from_port="output" to_op="Generate Attributes (2)" to_port="example set input"/>
          <connect from_op="Generate Attributes (2)" 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="Generate Data by User Specification (2)" from_port="output" to_op="Generate Attributes" to_port="example set input"/>
          <connect from_op="Generate Attributes" from_port="example set output" to_port="result 2"/>
          <portSpacing port="source_input 1" spacing="0"/>
          <portSpacing port="sink_result 1" spacing="18"/>
          <portSpacing port="sink_result 2" spacing="90"/>
          <portSpacing port="sink_result 3" spacing="0"/>
        </process>
      </operator>
    </process>
    Best,
    Nils
  • rowan_growan_g Member Posts: 47 Contributor II
    Sorry - didn't realise date parse custom was the operator to use.

    Thanks!
Sign In or Register to comment.