• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

Error explanation please

 
Rancher
Posts: 623
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Norm

I have updated that line to refer now to AutoWeka.model which I saved after running AutoWeka classifier in weka

Bob M
 
Bob Matthews
Rancher
Posts: 623
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A reply from Peter Reutemann.............

> If I wished to use the meta AutoWEKA classifier, what changes, if any,
> would be required to WekaApp.data

I haven't used AutoWEKA myself. In theory, it should just act like any
other classifier (they all implement the same interface,
weka.classifiers.Classifier).

However, since AutoWEKA is a tool for parameter optimization (and can
take a long time, depending on the dataset), you would use that in an
offline fashion. You would then use the classifier/parameters that
AutoWEKA determined to be optimal for your data, build a classifier
with that and use this model in production.

Cheers, Peter
--
Peter Reutemann
Dept. of Computer Science
University of Waikato, NZ
+64 (7) 858-5174 (office)
+64 (7) 577-5304 (home office)
****************************************
What he is getting at is that Autoweka runs a whole lot of different classifiers and determines which is optimal
This could be J48 classifier for example
One would save this as J48.model and carry on making a prediction

I guess one approach is :-

Run AutoWeka off-line and get the optimal classifier - say it is j48
Rerun using J48 rather than Autoweka and save J48.model and put that reference in the code

At periodic intervals, rerun Autoweka with more instances for training and testing and if optimum model changes then -
rerun with that classifier, save model and update code reference
****************************************
What I will do is :-
1) rerun AutoWeka
2) get optimum classifier
3) rerun weka with that classifier and save model
4) update code to reference a particular classifier - not AutoWeka

Bob M
 
Bob Matthews
Rancher
Posts: 623
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK - did what I said above............

C:\Data Analysis>"C:\Program Files\Java\jdk-16.0.1\bin\java.exe" -cp .;weka.jar WekaApp
prediction: 0.0
Predicted label: TRUE

C:\Data Analysis>

i.e. everything is working OK
***************************
now I revert to my original problem  - how to create the necessary code to call WekaApp from within my main java program

see the beginning of this thread

In other words: -
(a) which code do I take from the adams package to call weka, provide a variable value [OSV] and get a prediction from the saved model ?
this code to be embedded in my main trading program at the required position

(b) which code do I take from the adams package as wekaApp ?

Bob M
 
Rancher
Posts: 4504
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Copy the contents of the main method of the WekaApp class to the appropriate location where you want its functionality.
 
Bob Matthews
Rancher
Posts: 623
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everybody

Thank you so much for all the contributions to this thread (esp. Norm)

Everything is working well now and in addition, I now know how to test java programs under the DOS Prompt before transferring to a larger java program

Today, in a couple of hours I will be attending the 2021 International Weka Conference from Waikato University, New Zealand - so hopefully, will learn more about weka's operations

Thank's again

Bob M
 
Norm Radder
Rancher
Posts: 4504
38
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

how to test java programs under the DOS Prompt


Did you create a batch file with the commandline in it to allow easy execution of the command?
Create a .bat file
add the command line
add MORE on the last line to keep the window open after the command line executes.
Have 2  batch files, one for compiling and one for execution.
Then clicking on the .bat file will execute the command, display the results and stay open because of the MORE
 
Bob Matthews
Rancher
Posts: 623
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No I haven't but yes I will

Such great advice !

Bob M
reply
    Bookmark Topic Watch Topic
  • New Topic