Quantcast

Run SVM model on command line

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Run SVM model on command line

Waldo Paz Rodriguez

Hello weka users,
I'm trying to run an SVM model using the command line, to test new cases, and I was wondering which command would be the most appropriate to do so, or should I do so using InputMappedClassifier.

I would appreciate any help.

 

Regards,

Waldo


_______________________________________________
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
|  
Report Content as Inappropriate

Re: Run SVM model on command line

Eibe Frank-2
Administrator
You don’t need to use the InputMappedClassifier if you make sure that the data with the test cases has exactly the same attribute information as the data with the training instances.

For example, let’s say your training data looks like this in ARFF format:

@relation train

@attribute x1 numeric
@attribute x2 numeric
@attribute class {positive, negative}

@data
1.2, 0.7, positive
0.7, 0.8, negative
...

Then the test data should look like this (the relation name is arbitrary though):

@relation test

@attribute x1 numeric
@attribute x2 numeric
@attribute class {positive, negative}
0.9, 0.6, negative
1.5, 0.4, positive
...

If you don’t have actual class values in the “test” set, i.e., if you want to get predictions for new cases for which you don’t know the actual class values, you’d use missing values in the class column:

@relation test

@attribute x1 numeric
@attribute x2 numeric
@attribute class {positive, negative}
1.7, 0.4, ?
0.3, 0.4, ?
...


Cheers,
Eibe

> On 1/02/2017, at 5:53 PM, Waldo Paz Rodriguez <[hidden email]> wrote:
>
> Hello weka users,
> I'm trying to run an SVM model using the command line, to test new cases, and I was wondering which command would be the most appropriate to do so, or should I do so using InputMappedClassifier.
>
> I would appreciate any help.
>  
> Regards,
> Waldo
> _______________________________________________
> 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Run SVM model on command line

Waldo Paz Rodriguez
In reply to this post by Waldo Paz Rodriguez

Thanks Eibe for all the tips, but I really need run the model using the InputMappedClassifier on a command line. In addition, it´s possible to get all the output predictions in a CSV file like you can configure in the Explorer? Which is the command for executing this?

 

Regards,

Waldo


_______________________________________________
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
|  
Report Content as Inappropriate

Re: Run SVM model on command line

Peter Reutemann
> Thanks Eibe for all the tips, but I really need run the model using the
> InputMappedClassifier on a command line. In addition, it´s possible to get
> all the output predictions in a CSV file like you can configure in the
> Explorer? Which is the command for executing this?

Run your classifier of choice on the command-line with the "-h" flag
and it will print out a help screen listing all available options
(classifier-specific and general options).

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
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
Loading...