Options

Apply filter of 'date and time' attribute

SohaibSohaib Member Posts: 1 Contributor I
edited November 2018 in Help
Hello,
I have one attribute named ‘rental time’ contain 2008, 2009, 2010, 2011, 2012 years of data sets of this format like “Mon Jan 14 07:32:30 CET 2008”. I want to apply filter for exclude 2008 and 2009 data. How should I apply filter in rapid miner to exclude this data.

I would be grateful to you.

Best regards,
Sohaib

Answers

  • Options
    Marco_BoeckMarco_Boeck Administrator, Moderator, Employee, Member, University Professor Posts: 1,996 RM Engineering
    Hi,

    in RapidMiner Studio 6 this is very easy: Just add a "Filter Examples" operator, and add one condition which says "date < 01/01/2008" and a second condition which says "date > 12/31/2009", set the filters to "Match any" and you are done. You don't even need to enter this yourself, you can use the new filter GUI to do so ;)

    image

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="6.0.000">
     <context>
       <input/>
       <output/>
       <macros/>
     </context>
     <operator activated="true" class="process" compatibility="6.0.000" expanded="true" name="Process">
       <process expanded="true">
         <operator activated="true" class="generate_sales_data" compatibility="6.0.000" expanded="true" height="60" name="Generate Sales Data" width="90" x="45" y="30"/>
         <operator activated="true" class="filter_examples" compatibility="6.0.000" expanded="true" height="76" name="Filter Examples" width="90" x="246" y="30">
           <list key="filters_list">
             <parameter key="filters_entry_key" value="date.lt.01/01/06"/>
             <parameter key="filters_entry_key" value="date.gt.12/31/07"/>
           </list>
           <parameter key="filters_logic_and" value="false"/>
         </operator>
         <connect from_op="Generate Sales Data" from_port="output" to_op="Filter Examples" to_port="example set input"/>
         <connect from_op="Filter Examples" 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>
    Regards,
    Marco
Sign In or Register to comment.