Java Doc for CheckClassifier.java in  » Science » weka » weka » classifiers » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Science » weka » weka.classifiers 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


weka.core.CheckScheme
   weka.classifiers.CheckClassifier

CheckClassifier
public class CheckClassifier extends CheckScheme (Code)
Class for examining the capabilities and finding problems with classifiers. If you implement a classifier 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 classifier don't exist, but this will help find some common ones.

Typical usage:

java weka.classifiers.CheckClassifier -W classifier_name classifier_options

CheckClassifier reports on the following:

  • Classifier abilities
    • Possible command line options to the classifier
    • Whether the classifier can predict nominal, numeric, string, date or relational class attributes. Warnings will be displayed if performance is worse than ZeroR
    • Whether the classifier can be trained incrementally
    • Whether the classifier can handle numeric predictor attributes
    • Whether the classifier can handle nominal predictor attributes
    • Whether the classifier can handle string predictor attributes
    • Whether the classifier can handle date predictor attributes
    • Whether the classifier can handle relational predictor attributes
    • Whether the classifier can handle multi-instance data
    • Whether the classifier can handle missing predictor values
    • Whether the classifier can handle missing class values
    • Whether a nominal classifier only handles 2 class problems
    • Whether the classifier can handle instance weights
  • Correct functioning
    • Correct initialisation during buildClassifier (i.e. no result changes when buildClassifier called repeatedly)
    • Whether incremental training produces the same results as during non-incremental training (which may or may not be OK)
    • Whether the classifier alters the data pased to it (number of instances, instance order, instance weights, etc)
    • Whether the toString() method works correctly before the classifier has been built.
  • Degenerate cases
    • building classifier with zero training instances
    • all but one predictor attribute values missing
    • all predictor attribute values missing
    • all but one class values missing
    • all class values missing
Running CheckClassifier with the debug option set will output the training and test datasets for any failed tests.

The weka.classifiers.AbstractClassifierTest uses this class to test all the classifiers. 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 20).
 -nominal <num>
 The number of nominal attributes (default 2).
 -nominal-values <num>
 The number of values for nominal attributes (default 1).
 -numeric <num>
 The number of numeric attributes (default 1).
 -string <num>
 The number of string attributes (default 1).
 -date <num>
 The number of date attributes (default 1).
 -relational <num>
 The number of relational attributes (default 1).
 -num-instances-relational <num>
 The number of instances in relational/bag attributes (default 10).
 -words <comma-separated-list>
 The words to use in string attributes.
 -word-separators <chars>
 The word separators to use in string attributes.
 -W
 Full name of the classifier analysed.
 eg: weka.classifiers.bayes.NaiveBayes
 (default weka.classifiers.rules.ZeroR)
 
 Options specific to classifier weka.classifiers.rules.ZeroR:
 
 -D
 If set, classifier is run in debug mode and
 may output additional info to the console
Options after -- are passed to the designated classifier.


author:
   Len Trigg (trigg@cs.waikato.ac.nz)
author:
   FracPete (fracpete at waikato dot ac dot nz)
version:
   $Revision: 1.32 $
See Also:   TestInstances



Field Summary
protected  Classifierm_Classifier
    


Method Summary
protected  boolean[]canHandleClassAsNthAttribute(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType, int classIndex)
     Checks whether the scheme can handle class attributes as Nth attribute.
protected  boolean[]canHandleMissing(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType, boolean predictorMissing, boolean classMissing, int missingLevel)
     Checks basic missing value handling of the scheme.
protected  boolean[]canHandleNClasses(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int numClasses)
     Checks whether nominal schemes can handle more than two classes.
protected  boolean[]canHandleOnlyClass(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, int classType)
     Checks whether the scheme can handle data that contains only the class attribute.
protected  boolean[]canHandleZeroTraining(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType)
     Checks whether the scheme can handle zero training instances.
protected  boolean[]canPredict(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType)
     Checks basic prediction of the scheme, for simple non-troublesome datasets.
protected  boolean[]canTakeOptions()
     Checks whether the scheme can take command line options.
protected  boolean[]correctBuildInitialisation(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType)
     Checks whether the scheme correctly initialises models when buildClassifier is called.
protected  boolean[]datasetIntegrity(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType, boolean predictorMissing, boolean classMissing)
     Checks whether the scheme alters the training dataset during training.
protected  boolean[]declaresSerialVersionUID()
     tests for a serialVersionUID.
public  voiddoTests()
    
protected  boolean[]doesntUseTestClassVal(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType)
     Checks whether the classifier erroneously uses the class value of test instances (if provided).
public  ClassifiergetClassifier()
    
public  String[]getOptions()
     Gets the current settings of the CheckClassifier.
protected  boolean[]instanceWeights(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType)
     Checks whether the classifier can handle instance weights. This test compares the classifier performance on two datasets that are identical except for the training weights.
public  EnumerationlistOptions()
     Returns an enumeration describing the available options.
public static  voidmain(String[] args)
    
protected  InstancesmakeTestDataset(int seed, int numInstances, int numNominal, int numNumeric, int numString, int numDate, int numRelational, int numClasses, int classType, boolean multiInstance)
     Make a simple set of instances, which can later be modified for use in specific tests.
protected  InstancesmakeTestDataset(int seed, int numInstances, int numNominal, int numNumeric, int numString, int numDate, int numRelational, int numClasses, int classType, int classIndex, boolean multiInstance)
     Make a simple set of instances with variable position of the class attribute, which can later be modified for use in specific tests.
protected  boolean[]multiInstanceHandler()
     Checks whether the scheme handles multi-instance data.
protected  voidprintAttributeSummary(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType)
    
protected  boolean[]runBasicTest(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType, int missingLevel, boolean predictorMissing, boolean classMissing, int numTrain, int numTest, int numClasses, FastVector accepts)
     Runs a text on the datasets with the given characteristics.
protected  boolean[]runBasicTest(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType, int classIndex, int missingLevel, boolean predictorMissing, boolean classMissing, int numTrain, int numTest, int numClasses, FastVector accepts)
     Runs a text on the datasets with the given characteristics.
public  voidsetClassifier(Classifier newClassifier)
     Set the classifier for boosting.
public  voidsetOptions(String[] options)
     Parses a given list of options.
protected  boolean[]testToString()
     Checks whether the scheme's toString() method works even though the classifies hasn't been built yet.
protected  boolean[]testWRTZeroR(Classifier classifier, Evaluation evaluation, Instances train, Instances test)
    
protected  voidtestsPerClassType(int classType, boolean updateable, boolean weighted, boolean multiInstance)
    
protected  boolean[]updateableClassifier()
     Checks whether the scheme can build models incrementally.
protected  boolean[]updatingEquality(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType)
     Checks whether an updateable scheme produces the same model when trained incrementally as when batch trained.
protected  boolean[]weightedInstancesHandler()
     Checks whether the scheme says it can handle instance weights.

Field Detail
m_Classifier
protected Classifier m_Classifier(Code)
The classifier to be examined





Method Detail
canHandleClassAsNthAttribute
protected boolean[] canHandleClassAsNthAttribute(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType, int classIndex)(Code)
Checks whether the scheme can handle class attributes as Nth attribute.
Parameters:
  nominalPredictor - if true use nominal predictor attributes
Parameters:
  numericPredictor - if true use numeric predictor attributes
Parameters:
  stringPredictor - if true use string predictor attributes
Parameters:
  datePredictor - if true use date predictor attributes
Parameters:
  relationalPredictor - if true use relational predictor attributes
Parameters:
  multiInstance - whether multi-instance is needed
Parameters:
  classType - the class type (NUMERIC, NOMINAL, etc.)
Parameters:
  classIndex - the index of the class attribute (0-based, -1 means last attribute) index 0 is true if the test was passed, index 1 is true if test was acceptable
See Also:   TestInstances.CLASS_IS_LAST



canHandleMissing
protected boolean[] canHandleMissing(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType, boolean predictorMissing, boolean classMissing, int missingLevel)(Code)
Checks basic missing value handling of the scheme. If the missing values cause an exception to be thrown by the scheme, this will be recorded.
Parameters:
  nominalPredictor - if true use nominal predictor attributes
Parameters:
  numericPredictor - if true use numeric predictor attributes
Parameters:
  stringPredictor - if true use string predictor attributes
Parameters:
  datePredictor - if true use date predictor attributes
Parameters:
  relationalPredictor - if true use relational predictor attributes
Parameters:
  multiInstance - whether multi-instance is needed
Parameters:
  classType - the class type (NUMERIC, NOMINAL, etc.)
Parameters:
  predictorMissing - true if the missing values may be in the predictors
Parameters:
  classMissing - true if the missing values may be in the class
Parameters:
  missingLevel - the percentage of missing values index 0 is true if the test was passed, index 1 is true if test was acceptable



canHandleNClasses
protected boolean[] canHandleNClasses(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int numClasses)(Code)
Checks whether nominal schemes can handle more than two classes. If a scheme is only designed for two-class problems it should throw an appropriate exception for multi-class problems.
Parameters:
  nominalPredictor - if true use nominal predictor attributes
Parameters:
  numericPredictor - if true use numeric predictor attributes
Parameters:
  stringPredictor - if true use string predictor attributes
Parameters:
  datePredictor - if true use date predictor attributes
Parameters:
  relationalPredictor - if true use relational predictor attributes
Parameters:
  multiInstance - whether multi-instance is needed
Parameters:
  numClasses - the number of classes to test index 0 is true if the test was passed, index 1 is true if test was acceptable



canHandleOnlyClass
protected boolean[] canHandleOnlyClass(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, int classType)(Code)
Checks whether the scheme can handle data that contains only the class attribute. If a scheme cannot build a proper model with that data, it should default back to a ZeroR model.
Parameters:
  nominalPredictor - if true use nominal predictor attributes
Parameters:
  numericPredictor - if true use numeric predictor attributes
Parameters:
  stringPredictor - if true use string predictor attributes
Parameters:
  datePredictor - if true use date predictor attributes
Parameters:
  relationalPredictor - if true use relational predictor attributes
Parameters:
  classType - the class type (NOMINAL, NUMERIC, etc.) index 0 is true if the test was passed, index 1 is true if test was acceptable



canHandleZeroTraining
protected boolean[] canHandleZeroTraining(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType)(Code)
Checks whether the scheme can handle zero training instances.
Parameters:
  nominalPredictor - if true use nominal predictor attributes
Parameters:
  numericPredictor - if true use numeric predictor attributes
Parameters:
  stringPredictor - if true use string predictor attributes
Parameters:
  datePredictor - if true use date predictor attributes
Parameters:
  relationalPredictor - if true use relational predictor attributes
Parameters:
  multiInstance - whether multi-instance is needed
Parameters:
  classType - the class type (NUMERIC, NOMINAL, etc.) index 0 is true if the test was passed, index 1 is true if test was acceptable



canPredict
protected boolean[] canPredict(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType)(Code)
Checks basic prediction of the scheme, for simple non-troublesome datasets.
Parameters:
  nominalPredictor - if true use nominal predictor attributes
Parameters:
  numericPredictor - if true use numeric predictor attributes
Parameters:
  stringPredictor - if true use string predictor attributes
Parameters:
  datePredictor - if true use date predictor attributes
Parameters:
  relationalPredictor - if true use relational predictor attributes
Parameters:
  multiInstance - whether multi-instance is needed
Parameters:
  classType - the class type (NOMINAL, NUMERIC, etc.) index 0 is true if the test was passed, index 1 is true if test was acceptable



canTakeOptions
protected boolean[] canTakeOptions()(Code)
Checks whether the scheme can take command line options. index 0 is true if the classifier can take options



correctBuildInitialisation
protected boolean[] correctBuildInitialisation(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType)(Code)
Checks whether the scheme correctly initialises models when buildClassifier is called. This test calls buildClassifier with one training dataset and records performance on a test set. buildClassifier is then called on a training set with different structure, and then again with the original training set. The performance on the test set is compared with the original results and any performance difference noted as incorrect build initialisation.
Parameters:
  nominalPredictor - if true use nominal predictor attributes
Parameters:
  numericPredictor - if true use numeric predictor attributes
Parameters:
  stringPredictor - if true use string predictor attributes
Parameters:
  datePredictor - if true use date predictor attributes
Parameters:
  relationalPredictor - if true use relational predictor attributes
Parameters:
  multiInstance - whether multi-instance is needed
Parameters:
  classType - the class type (NUMERIC, NOMINAL, etc.) index 0 is true if the test was passed, index 1 is true if thescheme performs worse than ZeroR, but without error (index 0 isfalse)



datasetIntegrity
protected boolean[] datasetIntegrity(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType, boolean predictorMissing, boolean classMissing)(Code)
Checks whether the scheme alters the training dataset during training. If the scheme needs to modify the training data it should take a copy of the training data. Currently checks for changes to header structure, number of instances, order of instances, instance weights.
Parameters:
  nominalPredictor - if true use nominal predictor attributes
Parameters:
  numericPredictor - if true use numeric predictor attributes
Parameters:
  stringPredictor - if true use string predictor attributes
Parameters:
  datePredictor - if true use date predictor attributes
Parameters:
  relationalPredictor - if true use relational predictor attributes
Parameters:
  multiInstance - whether multi-instance is needed
Parameters:
  classType - the class type (NUMERIC, NOMINAL, etc.)
Parameters:
  predictorMissing - true if we know the classifier can handle(at least) moderate missing predictor values
Parameters:
  classMissing - true if we know the classifier can handle(at least) moderate missing class values index 0 is true if the test was passed



declaresSerialVersionUID
protected boolean[] declaresSerialVersionUID()(Code)
tests for a serialVersionUID. Fails in case the scheme doesn't declare a UID. index 0 is true if the scheme declares a UID



doTests
public void doTests()(Code)
Begin the tests, reporting results to System.out



doesntUseTestClassVal
protected boolean[] doesntUseTestClassVal(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType)(Code)
Checks whether the classifier erroneously uses the class value of test instances (if provided). Runs the classifier with test instance class values set to missing and compares with results when test instance class values are left intact.
Parameters:
  nominalPredictor - if true use nominal predictor attributes
Parameters:
  numericPredictor - if true use numeric predictor attributes
Parameters:
  stringPredictor - if true use string predictor attributes
Parameters:
  datePredictor - if true use date predictor attributes
Parameters:
  relationalPredictor - if true use relational predictor attributes
Parameters:
  multiInstance - whether multi-instance is needed
Parameters:
  classType - the class type (NUMERIC, NOMINAL, etc.) index 0 is true if the test was passed



getClassifier
public Classifier getClassifier()(Code)
Get the classifier used as the classifier the classifier used as the classifier



getOptions
public String[] getOptions()(Code)
Gets the current settings of the CheckClassifier. an array of strings suitable for passing to setOptions



instanceWeights
protected boolean[] instanceWeights(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType)(Code)
Checks whether the classifier can handle instance weights. This test compares the classifier performance on two datasets that are identical except for the training weights. If the results change, then the classifier must be using the weights. It may be possible to get a false positive from this test if the weight changes aren't significant enough to induce a change in classifier performance (but the weights are chosen to minimize the likelihood of this).
Parameters:
  nominalPredictor - if true use nominal predictor attributes
Parameters:
  numericPredictor - if true use numeric predictor attributes
Parameters:
  stringPredictor - if true use string predictor attributes
Parameters:
  datePredictor - if true use date predictor attributes
Parameters:
  relationalPredictor - if true use relational predictor attributes
Parameters:
  multiInstance - whether multi-instance is needed
Parameters:
  classType - the class type (NUMERIC, NOMINAL, etc.) index 0 true if the test was passed



listOptions
public Enumeration listOptions()(Code)
Returns an enumeration describing the available options. an enumeration of all the available options.



main
public static void main(String[] args)(Code)
Test method for this class
Parameters:
  args - the commandline parameters



makeTestDataset
protected Instances makeTestDataset(int seed, int numInstances, int numNominal, int numNumeric, int numString, int numDate, int numRelational, int numClasses, int classType, boolean multiInstance) throws Exception(Code)
Make a simple set of instances, which can later be modified for use in specific tests.
Parameters:
  seed - the random number seed
Parameters:
  numInstances - the number of instances to generate
Parameters:
  numNominal - the number of nominal attributes
Parameters:
  numNumeric - the number of numeric attributes
Parameters:
  numString - the number of string attributes
Parameters:
  numDate - the number of date attributes
Parameters:
  numRelational - the number of relational attributes
Parameters:
  numClasses - the number of classes (if nominal class)
Parameters:
  classType - the class type (NUMERIC, NOMINAL, etc.)
Parameters:
  multiInstance - whether the dataset should a multi-instance dataset the test dataset
throws:
  Exception - if the dataset couldn't be generated
See Also:   CheckClassifier.process(Instances)



makeTestDataset
protected Instances makeTestDataset(int seed, int numInstances, int numNominal, int numNumeric, int numString, int numDate, int numRelational, int numClasses, int classType, int classIndex, boolean multiInstance) throws Exception(Code)
Make a simple set of instances with variable position of the class attribute, which can later be modified for use in specific tests.
Parameters:
  seed - the random number seed
Parameters:
  numInstances - the number of instances to generate
Parameters:
  numNominal - the number of nominal attributes
Parameters:
  numNumeric - the number of numeric attributes
Parameters:
  numString - the number of string attributes
Parameters:
  numDate - the number of date attributes
Parameters:
  numRelational - the number of relational attributes
Parameters:
  numClasses - the number of classes (if nominal class)
Parameters:
  classType - the class type (NUMERIC, NOMINAL, etc.)
Parameters:
  classIndex - the index of the class (0-based, -1 as last)
Parameters:
  multiInstance - whether the dataset should a multi-instance dataset the test dataset
throws:
  Exception - if the dataset couldn't be generated
See Also:   TestInstances.CLASS_IS_LAST
See Also:   CheckClassifier.process(Instances)



multiInstanceHandler
protected boolean[] multiInstanceHandler()(Code)
Checks whether the scheme handles multi-instance data. true if the classifier handles multi-instance data



printAttributeSummary
protected void printAttributeSummary(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType)(Code)
Print out a short summary string for the dataset characteristics
Parameters:
  nominalPredictor - true if nominal predictor attributes are present
Parameters:
  numericPredictor - true if numeric predictor attributes are present
Parameters:
  stringPredictor - true if string predictor attributes are present
Parameters:
  datePredictor - true if date predictor attributes are present
Parameters:
  relationalPredictor - true if relational predictor attributes are present
Parameters:
  multiInstance - whether multi-instance is needed
Parameters:
  classType - the class type (NUMERIC, NOMINAL, etc.)



runBasicTest
protected boolean[] runBasicTest(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType, int missingLevel, boolean predictorMissing, boolean classMissing, int numTrain, int numTest, int numClasses, FastVector accepts)(Code)
Runs a text on the datasets with the given characteristics.
Parameters:
  nominalPredictor - if true use nominal predictor attributes
Parameters:
  numericPredictor - if true use numeric predictor attributes
Parameters:
  stringPredictor - if true use string predictor attributes
Parameters:
  datePredictor - if true use date predictor attributes
Parameters:
  relationalPredictor - if true use relational predictor attributes
Parameters:
  multiInstance - whether multi-instance is needed
Parameters:
  classType - the class type (NUMERIC, NOMINAL, etc.)
Parameters:
  missingLevel - the percentage of missing values
Parameters:
  predictorMissing - true if the missing values may be in the predictors
Parameters:
  classMissing - true if the missing values may be in the class
Parameters:
  numTrain - the number of instances in the training set
Parameters:
  numTest - the number of instaces in the test set
Parameters:
  numClasses - the number of classes
Parameters:
  accepts - the acceptable string in an exception index 0 is true if the test was passed, index 1 is true if test was acceptable



runBasicTest
protected boolean[] runBasicTest(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType, int classIndex, int missingLevel, boolean predictorMissing, boolean classMissing, int numTrain, int numTest, int numClasses, FastVector accepts)(Code)
Runs a text on the datasets with the given characteristics.
Parameters:
  nominalPredictor - if true use nominal predictor attributes
Parameters:
  numericPredictor - if true use numeric predictor attributes
Parameters:
  stringPredictor - if true use string predictor attributes
Parameters:
  datePredictor - if true use date predictor attributes
Parameters:
  relationalPredictor - if true use relational predictor attributes
Parameters:
  multiInstance - whether multi-instance is needed
Parameters:
  classType - the class type (NUMERIC, NOMINAL, etc.)
Parameters:
  classIndex - the attribute index of the class
Parameters:
  missingLevel - the percentage of missing values
Parameters:
  predictorMissing - true if the missing values may be in the predictors
Parameters:
  classMissing - true if the missing values may be in the class
Parameters:
  numTrain - the number of instances in the training set
Parameters:
  numTest - the number of instaces in the test set
Parameters:
  numClasses - the number of classes
Parameters:
  accepts - the acceptable string in an exception index 0 is true if the test was passed, index 1 is true if test was acceptable



setClassifier
public void setClassifier(Classifier newClassifier)(Code)
Set the classifier for boosting.
Parameters:
  newClassifier - the Classifier to use.



setOptions
public void setOptions(String[] options) throws Exception(Code)
Parses a given list of options. 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 20).
 -nominal <num>
 The number of nominal attributes (default 2).
 -nominal-values <num>
 The number of values for nominal attributes (default 1).
 -numeric <num>
 The number of numeric attributes (default 1).
 -string <num>
 The number of string attributes (default 1).
 -date <num>
 The number of date attributes (default 1).
 -relational <num>
 The number of relational attributes (default 1).
 -num-instances-relational <num>
 The number of instances in relational/bag attributes (default 10).
 -words <comma-separated-list>
 The words to use in string attributes.
 -word-separators <chars>
 The word separators to use in string attributes.
 -W
 Full name of the classifier analysed.
 eg: weka.classifiers.bayes.NaiveBayes
 (default weka.classifiers.rules.ZeroR)
 
 Options specific to classifier weka.classifiers.rules.ZeroR:
 
 -D
 If set, classifier is run in debug mode and
 may output additional info to the console

Parameters:
  options - the list of options as an array of strings
throws:
  Exception - if an option is not supported



testToString
protected boolean[] testToString()(Code)
Checks whether the scheme's toString() method works even though the classifies hasn't been built yet. index 0 is true if the toString() method works fine



testWRTZeroR
protected boolean[] testWRTZeroR(Classifier classifier, Evaluation evaluation, Instances train, Instances test) throws Exception(Code)
Determine whether the scheme performs worse than ZeroR during testing
Parameters:
  classifier - the pre-trained classifier
Parameters:
  evaluation - the classifier evaluation object
Parameters:
  train - the training data
Parameters:
  test - the test data index 0 is true if the scheme performs better than ZeroR
throws:
  Exception - if there was a problem during the scheme's testing



testsPerClassType
protected void testsPerClassType(int classType, boolean updateable, boolean weighted, boolean multiInstance)(Code)
Run a battery of tests for a given class attribute type
Parameters:
  classType - true if the class attribute should be numeric
Parameters:
  updateable - true if the classifier is updateable
Parameters:
  weighted - true if the classifier says it handles weights
Parameters:
  multiInstance - true if the classifier is a multi-instance classifier



updateableClassifier
protected boolean[] updateableClassifier()(Code)
Checks whether the scheme can build models incrementally. index 0 is true if the classifier can train incrementally



updatingEquality
protected boolean[] updatingEquality(boolean nominalPredictor, boolean numericPredictor, boolean stringPredictor, boolean datePredictor, boolean relationalPredictor, boolean multiInstance, int classType)(Code)
Checks whether an updateable scheme produces the same model when trained incrementally as when batch trained. The model itself cannot be compared, so we compare the evaluation on test data for both models. It is possible to get a false positive on this test (likelihood depends on the classifier).
Parameters:
  nominalPredictor - if true use nominal predictor attributes
Parameters:
  numericPredictor - if true use numeric predictor attributes
Parameters:
  stringPredictor - if true use string predictor attributes
Parameters:
  datePredictor - if true use date predictor attributes
Parameters:
  relationalPredictor - if true use relational predictor attributes
Parameters:
  multiInstance - whether multi-instance is needed
Parameters:
  classType - the class type (NUMERIC, NOMINAL, etc.) index 0 is true if the test was passed



weightedInstancesHandler
protected boolean[] weightedInstancesHandler()(Code)
Checks whether the scheme says it can handle instance weights. true if the classifier handles instance weights



Fields inherited from weka.core.CheckScheme
protected boolean m_ClasspathProblems(Code)(Java Doc)
protected int m_NumDate(Code)(Java Doc)
protected int m_NumInstances(Code)(Java Doc)
protected int m_NumInstancesRelational(Code)(Java Doc)
protected int m_NumNominal(Code)(Java Doc)
protected int m_NumNumeric(Code)(Java Doc)
protected int m_NumRelational(Code)(Java Doc)
protected int m_NumString(Code)(Java Doc)
protected PostProcessor m_PostProcessor(Code)(Java Doc)
protected String m_WordSeparators(Code)(Java Doc)
protected String[] m_Words(Code)(Java Doc)

Methods inherited from weka.core.CheckScheme
protected void addMissing(Instances data, int level, boolean predictorMissing, boolean classMissing)(Code)(Java Doc)
protected static String arrayToList(String[] value)(Code)(Java Doc)
public static String attributeTypeToString(int type)(Code)(Java Doc)
protected void compareDatasets(Instances data1, Instances data2) throws Exception(Code)(Java Doc)
abstract public void doTests()(Code)(Java Doc)
public int getNumDate()(Code)(Java Doc)
public int getNumInstances()(Code)(Java Doc)
public int getNumInstancesRelational()(Code)(Java Doc)
public int getNumNominal()(Code)(Java Doc)
public int getNumNumeric()(Code)(Java Doc)
public int getNumRelational()(Code)(Java Doc)
public int getNumString()(Code)(Java Doc)
public String[] getOptions()(Code)(Java Doc)
public PostProcessor getPostProcessor()(Code)(Java Doc)
public String getWordSeparators()(Code)(Java Doc)
public String getWords()(Code)(Java Doc)
public boolean hasClasspathProblems()(Code)(Java Doc)
public Enumeration listOptions()(Code)(Java Doc)
protected static String[] listToArray(String value)(Code)(Java Doc)
protected Instances process(Instances data)(Code)(Java Doc)
public void setNumDate(int value)(Code)(Java Doc)
public void setNumInstances(int value)(Code)(Java Doc)
public void setNumInstancesRelational(int value)(Code)(Java Doc)
public void setNumNominal(int value)(Code)(Java Doc)
public void setNumNumeric(int value)(Code)(Java Doc)
public void setNumRelational(int value)(Code)(Java Doc)
public void setNumString(int value)(Code)(Java Doc)
public void setOptions(String[] options) throws Exception(Code)(Java Doc)
public void setPostProcessor(PostProcessor value)(Code)(Java Doc)
public void setWordSeparators(String value)(Code)(Java Doc)
public void setWords(String value)(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.