Re: simplest of code
Peter Reutemann <[email protected]>
| Newsgroups | gmane.comp.ai.weka |
|---|---|
| Message-ID | <CAHoQ12L52RM3r-XpvnoNPDX9sYAYy_n6NEyOti7Ae-DAeAr-OQ@mail.gmail.com> |
> I am viewing one minute data from the forex market in real time
>
> At certain times I wish to
>
> 1) recall a saved model
Use the weka.core.SerializationHelper helper class to load model and
header of data it was trained with ("readAll" method):
https://waikato.github.io/weka-wiki/serialization/
> 2) present it with one new instance which comprises just one real variable
The following article describes how to create an Instances object on
the fly and saving it to an ARFF file. Since you are loading the
header (ie empty Instances object) with your model, you can skip
straight to creating Instance objects ("first instance"). You don't
need to add the Instance to the Instances (ie header), simply
reference the header information via "setDataset(Instances)":
https://waikato.github.io/weka-wiki/formats_and_processing/creating_arff_file/
> 3) have the model do a prediction based on this new instance
Not sure whether your class is numeric or nominal, so you can either
use the model's:
- classifyInstance method to obtain regression value or class label index
- distributionForInstance method to obtain class distribution
Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174 (office)
+64 (7) 577-5304 (home office)
http://www.cms.waikato.ac.nz/~fracpete/
http://www.data-mining.co.nz/
_______________________________________________
Wekalist mailing list -- [email protected]
Send posts to [email protected]
To unsubscribe send an email to [email protected]
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