Options

Choosing attributes

Legacy UserLegacy User Member Posts: 0 Newbie
edited November 2018 in Help
Hi

1. I want to know how can I selectt the attributes that I want to involve in the training. My file is an *.ARFF file. I have 20 attributes (fields) but I want to use only some of them.

2. Where to indicate the predited attribute ?

3. Can I choose more than one predicted attribute ?

Thank you

Answers

  • Options
    Legacy UserLegacy User Member Posts: 0 Newbie
    Can you please help ? :((
  • Options
    TobiasMalbrechtTobiasMalbrecht Moderator, Employee, Member Posts: 295 RM Product Management
    Hi,

    since it seems you are really desperately trying to get some analysis started and since I am almost finished with my wishlist noting everything that I want for Christmas (maybe I should rather be polite and say "would like to have" since I don't want to ruin with Santa Claus), I think I can give you some hints.
    ideale wrote:

    1. I want to know how can I selectt the attributes that I want to involve in the training. My file is an *.ARFF file. I have 20 attributes (fields) but I want to use only some of them.
    Use the [tt]AttributeFilter[/tt] operator which allows to filter attributes given their types or their names (specified as regular expression).
    ideale wrote:

    2. Where to indicate the predited attribute ?
    Using the [tt]ChangeAttributeRole[/tt] operator you can mark an attribute as label which is the attribute which should be predicted from the other (regular) attributes.
    ideale wrote:

    3. Can I choose more than one predicted attribute ?
    In principal you can only build a model for one label at a time. You can of course iteratively mark attributes as label and build a model for each label in each iteration. Maybe you start by getting the basic analysis set up. Then the [tt]FeatureIterator[/tt] operator might be the choice for you to achieve what you want ...
    ideale wrote:

    Thank you
    You are welcome. :)
    Hoping you now can really start with the analyses,
    Tobias

  • Options
    Legacy UserLegacy User Member Posts: 0 Newbie
    Hi Tobias, Thank you sooo much ! :)

    Here is the header of my arff file

    @RELATION XY
    @ATTRIBUTE student    string
    @ATTRIBUTE group  {1,2,3}
    @ATTRIBUTE sexe  {F,M}
    @ATTRIBUTE age  NUMERIC
    @ATTRIBUTE english {1,2,3,4,5}
    @ATTRIBUTE pleasure  {1,2,3,4,5,6,7,8,9}
    @ATTRIBUTE arousal  {1,2,3,4,5,6,7,8,9}
    @ATTRIBUTE dominance  {1,2,3,4,5,6,7,8,9}

    I wat to use only the 4 first attributes (learner, group, sexe, age)
    Tobias Malbrecht wrote:

    Use the [tt]AttributeFilter[/tt] operator which allows to filter attributes given their types or their names (specified as regular expression).
    I used the attributeFilter

    I wrote in the condition_class parameter the following expression :
    attribute='student' ANDAND attribute='group' ANDAND attribute='sexe' ANDAND attribute='age'

    I had this error :

    G Dec 21, 2008 4:02:12 PM: [Fatal] UserError occured in 1st application of AttributeFilter (AttributeFilter)
    G Dec 21, 2008 4:02:12 PM: [Fatal] Process failed: Cannot instantiate 'attribute='group' ANDAND attribute='sexe'': Cannot find class 'attribute='group' ANDAND attribute='sexe''. Check your classpath.
              Root[1] (Process)
              +- ArffExampleSource[1] (ArffExampleSource)
    here ==> +- AttributeFilter[1] (AttributeFilter)
              +- ChangeAttributeRole[0] (ChangeAttributeRole)
              +- DecisionTree[0] (DecisionTree)
    Tobias Malbrecht wrote:

    Using the [tt]ChangeAttributeRole[/tt] operator you can mark an attribute as label which is the attribute which should be predicted from the other (regular) attributes.
    I wat sexe as the predicted parameter, so I used the ChangeAttributeRole.
    I wrote the name parameter the value :
    sexe

    Is this correct ? :( I'm so frustrated because I cant even start something :(
  • Options
    steffensteffen Member Posts: 347 Maven
    Hello ideale

    I wat to use only the 4 first attributes (learner, group, sexe, age)
    I used the attributeFilter

    I wrote in the condition_class parameter the following expression :
    attribute='student' ANDAND attribute='group' ANDAND attribute='sexe' ANDAND attribute='age'
    I suggest to use the operator FeatureNameFilter if you want to filter attributes by name. Simply because FeatureNameFilter allows the filtering of special attributes in opposite to AttributeFilter. The parameter settings in your case are this:
      
    <operator name="FeatureNameFilter" class="FeatureNameFilter">
            <parameter key="except_features_with_name" value="student||group||sexe||age"/>
            <parameter key="skip_features_with_name" value=".*"/>
      </operator>
    Simply copy and paste the text in the box to the xml-tab of your process.  The expression of yours is wrong, I suggest the tutorial.pdf (also available at sourceforge download page) where you can find the syntax of regular expressions.

    I wat sexe as the predicted parameter, so I used the ChangeAttributeRole.
    I wrote the name parameter the value :
    sexe
    I dont know. If this are your parameter settings,  you are correct :)
       
    <operator name="ChangeAttributeRole" class="ChangeAttributeRole">
            <parameter key="name" value="sexe"/>
            <parameter key="target_role" value="label"/>
    </operator>
    hint: If you press F1 during selection of an operator in the process tree, a short description of the operator will pop up.  In the case of ChangeAttributeRole, all types of attributes are explained.

    hope this was helpful

    regrads,

    Steffen
  • Options
    Legacy UserLegacy User Member Posts: 0 Newbie
    Thank you so much Tobias and Steffen. I have my next question now ... (please see my other thread ! :))
Sign In or Register to comment.