"[SOLVED] Filter attributes against whitelist"

mataiomataio MemberPosts:6Contributor I
edited June 2019 inHelp
Hello everybody,

I have an interesting problem which I could not solve on my own and hope someone can provide some help.

I have a table of data with several attributes and a whitelist of attribute names. Is there any possibility in RapidMiner to filter the attributes based on that list?

Thanks for your help in advance
Tagged:

Answers

  • MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University ProfessorPosts:3,404RM Data Scientist
    Hello matatio,

    you can do this using a whitelist in your repo/csv/excel/..

    You basicly read it and use a Loop values on the whitelist. I've created an example process on random data. I created an CSV file with two entries.

    one
    two
    Keep care of the excecution order. The remember operators need to be excecuted before their associated recall operators.




























    < portSpacing端口= "ource_in 1" spacing="0"/>
    < portSpacing端口= "ource_in 2" spacing="0"/>
    < portSpacing端口= "ink_out 1" spacing="0"/>
    < portSpacing端口= "ink_out 2" spacing="0"/>





























    < portSpacing端口= "ource_example set" spacing="0"/>
    < portSpacing端口= "ink_out 1" spacing="0"/>
    < portSpacing端口= "ink_out 2" spacing="0"/>










    < portSpacing端口= "ource_input 1" spacing="0"/>
    < portSpacing端口= "ink_result 1" spacing="0"/>
    < portSpacing端口= "ink_result 2" spacing="0"/>
    < portSpacing端口= "ink_result 3" spacing="0"/>




    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • mataiomataio MemberPosts:6Contributor I
    Thank you for your reply but I'm looking for something else, my whitelist contains the names of the attributes I want to keep, the rest should be removed. I don't have a specific attribute of type name.

    Basically, is it possible to use the operator Select Attributes instead of Filter Examples in the loop with the following parameters?
    - filter type: regular expression (?)
    - regular expression: something like attribute_name=%{loop_value}
  • MartinLiebigMartinLiebig Administrator, Moderator, Employee, RapidMiner Certified Analyst, RapidMiner Certified Expert, University ProfessorPosts:3,404RM Data Scientist
    Hi,

    yes. this is basicly one way to go. If you have a pattern what to filter. E.g. everything which starts with "att" you can use a simple regex for filtering. There are several tutorials around
    Otherwise you can simply use "single" in Generate Attribute and invert the selection. Attached is a process which should help you
















































    < portSpacing端口= "ource_example set" spacing="0"/>
    < portSpacing端口= "ink_out 1" spacing="0"/>
    < portSpacing端口= "ink_out 2" spacing="0"/>









    < portSpacing端口= "ource_input 1" spacing="0"/>
    < portSpacing端口= "ink_result 1" spacing="0"/>
    < portSpacing端口= "ink_result 2" spacing="0"/>
    < portSpacing端口= "ink_result 3" spacing="0"/>




    - Sr. Director Data Solutions, Altair RapidMiner -
    Dortmund, Germany
  • mataiomataio MemberPosts:6Contributor I
    非常感谢,完美的工作:)
Sign InorRegisterto comment.