Remove an attribute from loaded arff file

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

Remove an attribute from loaded arff file

Rafael Bellini
Hello folks!

The arff file I am using has the following attributes:

@attribute text string
@attribute @@class@@ {Negative,Positive,Regular}

In order to use a Classifier as LibSVM I need first to remove the "@attribute text string" attribute.
I did try to remove the first attribute using weka.filters.unsupervised.attribute.Remove() but this method removes the entire attribute, not just the "@attribute text string" line.
I wonder if someone could help me to figure how do I remove this line from the arff file loaded please.

P.S. I can remove it manually from Explorer Window, Attributes field. That is the action I want to mimicry using Java code.

Thank you,
Rafael

Enviado via UCSMail.

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html
Reply | Threaded
Open this post in threaded view
|

Re: Remove an attribute from loaded arff file

Eibe Frank-2
Administrator
I think what you are after is the StringToWordVector filter, which you can apply with LibSVM by configuring WEKA’s FilteredClassifier (under “meta” in the list of classifiers).

Cheers,
Eibe

> On 11/05/2017, at 12:47 PM, Rafael Bellini <[hidden email]> wrote:
>
> Hello folks!
>
> The arff file I am using has the following attributes:
>
> @attribute text string
> @attribute @@class@@ {Negative,Positive,Regular}
>
> In order to use a Classifier as LibSVM I need first to remove the "@attribute text string" attribute.
> I did try to remove the first attribute using weka.filters.unsupervised.attribute.Remove() but this method removes the entire attribute, not just the "@attribute text string" line.
> I wonder if someone could help me to figure how do I remove this line from the arff file loaded please.
>
> P.S. I can remove it manually from Explorer Window, Attributes field. That is the action I want to mimicry using Java code.
>
> Thank you,
> Rafael
>
> Enviado via UCSMail.
> _______________________________________________
> Wekalist mailing list
> Send posts to: [hidden email]
> List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
> List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html

_______________________________________________
Wekalist mailing list
Send posts to: [hidden email]
List info and subscription status: https://list.waikato.ac.nz/mailman/listinfo/wekalist
List etiquette: http://www.cs.waikato.ac.nz/~ml/weka/mailinglist_etiquette.html