|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectweka.estimators.CheckEstimator
public class CheckEstimator
Class for examining the capabilities and finding problems with estimators. If you implement a estimator using the WEKA.libraries, you should run the checks on it to ensure robustness and correct operation. Passing all the tests of this object does not mean bugs in the estimator don't exist, but this will help find some common ones.
Typical usage:java weka.estimators.CheckEstimator -W estimator_name
estimator_options
This class uses code from the CheckEstimatorClass
ATTENTION! Current estimators can only
1. split on a nominal class attribute
2. build estimators for nominal and numeric attributes
3. build estimators independendly of the class type
The functionality to test on other class and attribute types
is left in big parts in the code.
CheckEstimator reports on the following:
weka.estimators.AbstractEstimatorTest
uses this
class to test all the estimators. Any changes here, have to be
checked in that abstract test class, too.
Valid options are:
-D Turn on debugging output.
-S Silent mode - prints nothing to stdout.
-N <num> The number of instances in the datasets (default 100).
-W Full name of the estimator analysed. eg: weka.estimators.NormalEstimator
Options specific to estimator weka.estimators.NormalEstimator:
-D If set, estimator is run in debug mode and may output additional info to the consoleOptions after -- are passed to the designated estimator.
TestInstances
Nested Class Summary | |
---|---|
static class |
CheckEstimator.AttrTypes
class that contains info about the attribute types the estimator can estimate estimator work on one attribute only |
static class |
CheckEstimator.EstTypes
public class that contains info about the chosen attribute type estimator work on one attribute only |
class |
CheckEstimator.PostProcessor
a class for postprocessing the test-data |
Constructor Summary | |
---|---|
CheckEstimator()
|
Method Summary | |
---|---|
void |
doTests()
Begin the tests, reporting results to System.out |
boolean |
getDebug()
Get whether debugging is turned on |
Estimator |
getEstimator()
Get the estimator used as the estimator |
static int |
getMinMax(Instances inst,
int attrIndex,
double[] minMax)
Find the minimum and the maximum of the attribute and return it in the last parameter.. |
int |
getNumInstances()
Gets the current number of instances to use for the datasets. |
java.lang.String[] |
getOptions()
Gets the current settings of the CheckEstimator. |
CheckEstimator.PostProcessor |
getPostProcessor()
returns the current PostProcessor, can be null |
java.lang.String |
getRevision()
Returns the revision string. |
boolean |
getSilent()
Get whether silent mode is turned on |
boolean |
hasClasspathProblems()
returns TRUE if the estimator returned a "not in classpath" Exception |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(java.lang.String[] args)
Test method for this class |
void |
setDebug(boolean debug)
Set debugging mode |
void |
setEstimator(Estimator newEstimator)
Set the estimator for boosting. |
void |
setNumInstances(int value)
Sets the number of instances to use in the datasets (some estimators might require more instances). |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
void |
setPostProcessor(CheckEstimator.PostProcessor value)
sets the PostProcessor to use |
void |
setSilent(boolean value)
Set slient mode, i.e., no output at all to stdout |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CheckEstimator()
Method Detail |
---|
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-D Turn on debugging output.
-S Silent mode - prints nothing to stdout.
-N <num> The number of instances in the datasets (default 100).
-W Full name of the estimator analysed. eg: weka.estimators.NormalEstimator
Options specific to estimator weka.estimators.NormalEstimator:
-D If set, estimator is run in debug mode and may output additional info to the console
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 setPostProcessor(CheckEstimator.PostProcessor value)
value
- the new PostProcessorm_PostProcessor
public CheckEstimator.PostProcessor getPostProcessor()
public boolean hasClasspathProblems()
public void doTests()
public void setDebug(boolean debug)
debug
- true if debug output should be printedpublic boolean getDebug()
public void setSilent(boolean value)
value
- whether silent mode is active or notpublic boolean getSilent()
public void setNumInstances(int value)
value
- the number of instances to usepublic int getNumInstances()
public void setEstimator(Estimator newEstimator)
newEstimator
- the Estimator to use.public Estimator getEstimator()
public static int getMinMax(Instances inst, int attrIndex, double[] minMax) throws java.lang.Exception
inst
- instances used to build the estimatorattrIndex
- index of the attributeminMax
- the array to return minimum and maximum in
java.lang.Exception
- if parameter minMax wasn't initialized properlypublic java.lang.String getRevision()
getRevision
in interface RevisionHandler
public static void main(java.lang.String[] args)
args
- the commandline parameters
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |