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

[SOLVED] Issue: how to implemet a dynamic filter on Rapidminer

jseekerjseeker Member Posts: 12 Contributor II
edited August 2019 in Help
Dear community members,
I'm using RapidMiner and RapidAnalytics for analyse a dataset, downloaded from http://archive.ics.uci.edu/ml/machine-learning-databases/00257/Data_User_Modeling_Dataset_Hamdi%20Tolga%20KAHRAMAN.xls
I want to filter my dataset by UNS column.
In rapidMiner I already implemented a process like this image and I export this process on RapidAnalytics.
How we can see the last block is a filter example with attribute_value_filter set on UNS with regular expression value.
Now i'm going to implement a dynamic filter, but i dont know how do that.
I have to filter data by label : Very Low, Low, Middle and High.
My final result should be a dynamic process on RapidAnalytics that allows to see four data view.
Anyone could help me ?

Thank in advance.

bye
Tagged:

Answers

  • MariusHelfMariusHelf RapidMiner Certified Expert, Member Posts: 1,869 Unicorn
    Hi,

    how do you access RapidAnalytics? Are you using a webservice? In that case you could make use of macros.

    In RapidMiner define a macro called "filterValue" in the Process Context (you find it next to the Parameters tab in the upper right).
    Then define your filter as
    UNS = .*%{filterValue}.*
    This allows you to provide the filterValue as a macro value in RapidMiner. This macro value can also be exported to the webservice, and you can call it by something like http://my.rapidminer.server.com/myWebservice?filterValue=High

    Best regards,
    Marius
  • jseekerjseeker Member Posts: 12 Contributor II
    Hi Marius,
    thank you so much for the answer.
    I access to rapidAnalytics with firefox browser and i use a webservice.
    Added the macro in rapidMiner, image attached
    image
    Now , I would export this macro into webservice, but when i set up the service i don't find anything.
    image
    Right now, i tryed to insert the macro in url query parameter like this
    image
    My result on service test is
    image
    I typed the low value but the filter doesn't work :(
    where is my mistake?

    Thank you

    Regards.
  • MariusHelfMariusHelf RapidMiner Certified Expert, Member Posts: 1,869 Unicorn
    Hi,

    you are using the Set Macro operator, but to make the filter work you have to use the process context as described above.

    Best regards,
    Marius
  • jseekerjseeker Member Posts: 12 Contributor II
    Hi,
    unfortunately i've no result in my table.
    It's becoming a nightmare.
    I'm going to write what i did. So, i restored my previous process context in rapidMiner.
    I'm using a filter example with :
    - condition_class -> attribute_value_filter
    - parameter string -> UNS = .*%{filterValue}.*
    I even exported the process in rapidAnalytic such as service and added the same rapidMiner's macro.

    In Service Settings
    Parameter binding :
    - URL query parameter -> filterValue
    - Target (macro/operator parameter) -> UNS = .*%{filterValue}.*

    when I tried to test the service, it request me the parameter, i write for example Low and my result always is empty table :(

    Why ?

    I must finish this project as soon as possibile.
    And you Marius are my hope.

    Thank for the patience
    Regards.
  • Marco_BoeckMarco_Boeck Administrator, Moderator, Employee-RapidMiner, Member, University Professor Posts: 1,996 RM Engineering
    Hi,

    in the service settings on the server, URL-Query-Parameter and Target must be identical, i.e. "filterValue" in your case.

    Testprocess:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <process version="5.3.014">
      <context>
        <input/>
        <output/>
        <macros>
          <macro>
            <key>filterValue</key>
            <value/>
          </macro>
        </macros>
      </context>
      <operator activated="true" class="process" compatibility="5.3.014" expanded="true" name="Process">
        <process expanded="true">
          <operator activated="true" class="generate_nominal_data" compatibility="5.3.014" expanded="true" height="60" name="Generate Nominal Data" width="90" x="45" y="30"/>
          <operator activated="true" class="filter_examples" compatibility="5.3.014" expanded="true" height="76" name="Filter Examples" width="90" x="179" y="30">
            <parameter key="parameter_string" value="att1 = .*%{filterValue}.*"/>
            <parameter key="condition_class" value="attribute_value_filter"/>
            <list key="filters_list"/>
          </operator>
          <connect from_op="Generate Nominal 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>

    These two must be identical and match the macro value in the process context and the filter operator
    image

    This is an example of a test with the filter set to "value0".
    image

    Regards,
    Marco
  • jseekerjseeker Member Posts: 12 Contributor II
    Hi,
    Finally i solved my problem =)
    Thank you so much.
    I'll open very soon another post for how to predict the level of user's knowledge.
    I'm using the same dataset, i have five attributes and one UNS label, that says me  the level of user belongs.
    I'm very thankful for your precious help.

    Regards.

    :)
Sign In or Register to comment.