|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.classifiers.CheckSource
public class CheckSource
A simple class for checking the source generated from Classifiers
implementing the weka.classifiers.Sourcable
interface.
It takes a classifier, the classname of the generated source
and the dataset the source was generated with as parameters and tests
the output of the built classifier against the output of the generated
source. Use option '-h' to display all available commandline options.
Valid options are:
-W <classname and options> The classifier (incl. options) that was used to generate the source code.
-S <classname> The classname of the generated source code.
-t <file> The training set with which the source code was generated.
-c <index> The class index of the training set. 'first' and 'last' are valid indices. (default: last)Options after -- are passed to the designated classifier (specified with -W).
Sourcable
Constructor Summary | |
---|---|
CheckSource()
|
Method Summary | |
---|---|
boolean |
execute()
performs the comparison test |
Classifier |
getClassifier()
Gets the classifier being used for the tests, can be null. |
int |
getClassIndex()
Gets the class index of the dataset. |
java.io.File |
getDataset()
Gets the dataset to use for testing, can be null. |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier. |
Classifier |
getSourceCode()
Gets the class to test. |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(java.lang.String[] args)
Executes the tests, use "-h" to list the commandline options. |
void |
setClassifier(Classifier value)
Sets the classifier to use for the comparison. |
void |
setClassIndex(int value)
Sets the class index of the dataset. |
void |
setDataset(java.io.File value)
Sets the dataset to use for testing. |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setSourceCode(Classifier value)
Sets the class to test. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CheckSource()
Method Detail |
---|
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-W <classname and options> The classifier (incl. options) that was used to generate the source code.
-S <classname> The classname of the generated source code.
-t <file> The training set with which the source code was generated.
-c <index> The class index of the training set. 'first' and 'last' are valid indices. (default: last)Options after -- are passed to the designated classifier (specified with -W).
setOptions
in interface OptionHandler
options
- the list of options as an array of strings
java.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
public void setClassifier(Classifier value)
value
- the classifier to usepublic Classifier getClassifier()
public void setSourceCode(Classifier value)
value
- the class to testpublic Classifier getSourceCode()
public void setDataset(java.io.File value)
value
- the dataset to use.public java.io.File getDataset()
public void setClassIndex(int value)
value
- the class index of the dataset.public int getClassIndex()
public boolean execute() throws java.lang.Exception
java.lang.Exception
- if tests failpublic static void main(java.lang.String[] args) throws java.lang.Exception
args
- the commandline parameters
java.lang.Exception
- if something goes wrong
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |