Ranked attributes from command line.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Ranked attributes from command line.

t.liu
Is there any gentleman can reply this question on Stackoverflow ?
https://stackoverflow.com/questions/56673137/weka-get-infogainattribute-selection-output-using-command-line

Briefly speaking, when using info gain and ranker in the Weka Explorer, it is possible to read the ranked features with a computed score.
Is there any way to read these information with command line ?

Many thanks in advance !
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to: To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit
https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Ranked attributes from command line.

Peter Reutemann
> Is there any gentleman can reply this question on Stackoverflow ?

[There are plenty of ladies here as well...]

> https://stackoverflow.com/questions/56673137/weka-get-infogainattribute-selection-output-using-command-line
>
> Briefly speaking, when using info gain and ranker in the Weka Explorer, it is possible to read the ranked features with a computed score.
> Is there any way to read these information with command line ?

[For completeness, I'm posting my answer here as well...]

When you look into the Explorer's log (click on button in bottom right
corner), you will see something like this in the output:

12:13:46: Started weka.attributeSelection.InfoGainAttributeEval
12:13:46: Command: weka.attributeSelection.InfoGainAttributeEval -s
"weka.attributeSelection.Ranker -T -1.7976931348623157E308 -N -1"
12:13:46: Filter command:
weka.filters.supervised.attribute.AttributeSelection -E
"weka.attributeSelection.InfoGainAttributeEval " -S
"weka.attributeSelection.Ranker -T -1.7976931348623157E308 -N -1"
12:13:46: Meta-classifier command:
weka.classifiers.meta.AttributeSelectedClassifier -E
"weka.attributeSelection.InfoGainAttributeEval " -S
"weka.attributeSelection.Ranker -T -1.7976931348623157E308 -N -1" -W
weka.classifiers.trees.J48 -- -C 0.25 -M 2
12:13:46: Finished weka.attributeSelection.InfoGainAttributeEval
weka.attributeSelection.Ranker

If you want to get the output from the Explorer, you use "Command", if
you want to filter your data, you use "Filter command" and when you
want to train a classifier, you use "Meta-classifier command".

In your case, the command therefore would something like this (no output file!):
java -classpath weka.jar weka.attributeSelection.InfoGainAttributeEval
-s "weka.attributeSelection.Ranker -T -1.7976931348623157E308 -N -1"
-i input.arff

That you received the same data in "output.arff" as you used as input
via "input.arff" is expected, as the "Ranker" only ranks the
attributes, but doesn't actually modify the data itself.

Rule of thumb: "SubsetEval" schemes will modify the dataset,
"AttributeEval" schemes can be used for ranking.

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
Wekalist mailing list -- [hidden email]
Send posts to: To unsubscribe send an email to [hidden email]
To subscribe, unsubscribe, etc., visit
https://list.waikato.ac.nz/postorius/lists/wekalist.list.waikato.ac.nz
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html