xml and experiment problem

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

xml and experiment problem

Stijn Lievens
Hi Weka Users,

I have a problem using xml-saved experiments from the command line.

What I try to do is the following.
I use the Experimenter (java weka.gui.experiment.Experimenter) to set up
an experiment, and then I save it in xml-format (to,let's say, myExp.xml)
When I close the Experimenter, and restart it, I can open myExp.xml
without a problem and run the experiment.

However, when I try to run the experiment from the command line:

java weka.experiment.Experiment -xml myExp.xml -r

nothing happens, except that the string "null" is printed on standard error.

I tried to locate the problem in the file 'Experiment.java', and it
recognizes that I want to use an xml file.  After excuting the line

args = new XMLOptions(xmlOption).toArray();

args contains only one null argument.  I suspect that args should
contain arguments describing the experiment after executing this line.

I'm wondering if I am missing something obvious here?
I'm using Weka 3.4.5.

Cheers,

Stijn Lievens.
--

_______________________________________________
Wekalist mailing list
[hidden email]
https://list.scms.waikato.ac.nz/mailman/listinfo/wekalist
Reply | Threaded
Open this post in threaded view
|

Re: xml and experiment problem

Peter Reutemann
> I have a problem using xml-saved experiments from the command line.
>
> What I try to do is the following.
> I use the Experimenter (java weka.gui.experiment.Experimenter) to set up
> an experiment, and then I save it in xml-format (to,let's say, myExp.xml)
> When I close the Experimenter, and restart it, I can open myExp.xml
> without a problem and run the experiment.
>
> However, when I try to run the experiment from the command line:
>
> java weka.experiment.Experiment -xml myExp.xml -r
>
> nothing happens, except that the string "null" is printed on standard error.

There are currently two different places for XML in Weka:
- command line parameters
- serialized objects

With the above commandline, you're trying to load an XML serialized
experiment as a command line parameters XML file.
Classifiers and Experiments can take instead of normal command line
parameters (like "J48 -t some.arff -T another.arff -c 1") an XML file
that has these parameters stored in a hierachical structure (especially
meta classifiers can be real tricky on the command line). That's done
via the "-xml" parameter and not what you want to do.
An experiment automatically recognizes whether it is about to load a
binary serialized experiment or an XML serialized on (based on the
extension). You have to use this commandline:
    java weka.experiment.Experiment -l myExp.xml -r

Here's more about XML in WEKA:
    http://www.cs.waikato.ac.nz/~ml/weka/xml/

HTH

Cheers, Peter

--
Peter Reutemann, Dept. of Computer Science, University of Waikato, NZ
http://www.cs.waikato.ac.nz/~fracpete/     +64 (7) 838-4466 Ext. 5174

_______________________________________________
Wekalist mailing list
[hidden email]
https://list.scms.waikato.ac.nz/mailman/listinfo/wekalist
Reply | Threaded
Open this post in threaded view
|

Re: xml and experiment problem

Stijn Lievens
Peter Reutemann wrote:

>> I have a problem using xml-saved experiments from the command line.
>>
>> What I try to do is the following.
>> I use the Experimenter (java weka.gui.experiment.Experimenter) to set up
>> an experiment, and then I save it in xml-format (to,let's say, myExp.xml)
>> When I close the Experimenter, and restart it, I can open myExp.xml
>> without a problem and run the experiment.
>>
>> However, when I try to run the experiment from the command line:
>>
>> java weka.experiment.Experiment -xml myExp.xml -r
>>
>> nothing happens, except that the string "null" is printed on standard
>> error.
>
>
> There are currently two different places for XML in Weka:
> - command line parameters
> - serialized objects
>
> With the above commandline, you're trying to load an XML serialized
> experiment as a command line parameters XML file.
> Classifiers and Experiments can take instead of normal command line
> parameters (like "J48 -t some.arff -T another.arff -c 1") an XML file
> that has these parameters stored in a hierachical structure (especially
> meta classifiers can be real tricky on the command line). That's done
> via the "-xml" parameter and not what you want to do.
> An experiment automatically recognizes whether it is about to load a
> binary serialized experiment or an XML serialized on (based on the
> extension). You have to use this commandline:
>    java weka.experiment.Experiment -l myExp.xml -r
>

Thanks for your quick reply, it seems to work now ...

However, maybe the main method should be adjusted, because now
when doing

java weka.experiment.Experiment

(part of) the output is as follows:

<code>
  Usage:

-l <exp file>
         Load experiment from file (default use cli options)
</code>

This doesn't mention the possibility of giving an xml file as argument
to the "-l" option.  (In the Experimenter gui a difference is made
between "*.exp" and "*.xml" files)
This is why I tried the -xml option on the command line to load the
xml file generated by the Experimenter gui.

> Here's more about XML in WEKA:
>    http://www.cs.waikato.ac.nz/~ml/weka/xml/
>

OK, I will read this.

> HTH
>

It did.

> Cheers, Peter
>

Cheers,

Stijn Lievens,

_______________________________________________
Wekalist mailing list
[hidden email]
https://list.scms.waikato.ac.nz/mailman/listinfo/wekalist