Choosing attributes
Legacy User
New Altair Community Member
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
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
Tagged:
0
Answers
-
Can you please help ? (0
-
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.
Use the [tt]AttributeFilter[/tt] operator which allows to filter attributes given their types or their names (specified as regular expression).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.
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:
2. Where to indicate the predited 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:
3. Can I choose more than one predicted attribute ?
You are welcome.ideale wrote:
Thank you
Hoping you now can really start with the analyses,
Tobias
0 -
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)
I used the attributeFilterTobias Malbrecht wrote:
Use the [tt]AttributeFilter[/tt] operator which allows to filter attributes given their types or their names (specified as regular expression).
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)
I wat sexe as the predicted parameter, so I used the ChangeAttributeRole.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 wrote the name parameter the value :
sexe
Is this correct ? I'm so frustrated because I cant even start something0 -
Hello ideale
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:
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'
<operator name="FeatureNameFilter" class="FeatureNameFilter">
<parameter key="except_features_with_name" value="student||group||sexe||age"/>
<parameter key="skip_features_with_name" value=".*"/>
</operator>
I dont know. If this are your parameter settings, you are correct
I wat sexe as the predicted parameter, so I used the ChangeAttributeRole.
I wrote the name parameter the value :
sexe
<operator name="ChangeAttributeRole" class="ChangeAttributeRole">
<parameter key="name" value="sexe"/>
<parameter key="target_role" value="label"/>
</operator>
hope this was helpful
regrads,
Steffen0 -
Thank you so much Tobias and Steffen. I have my next question now ... (please see my other thread ! )0