shared
Class Inducer

java.lang.Object
  |
  +--shared.BaseInducer
        |
        +--shared.Inducer
Direct Known Subclasses:
IncrInducer, NaiveBayesInd, TDDTInducer

public abstract class Inducer
extends BaseInducer

The Inducer class "induces" a concept from a labelled training set (supervised learning). An Inducer is really an "Internal inducer," that is, one that we have a categorizer for (as opposed to the BaseInducer which may be external. The main routines added to BaseInducer are train() predict() (for a single instance), and get_categorizer(). Train_and_test() is implemented here in terms of the above.


Fields inherited from class shared.BaseInducer
AHA_IB_INDUCER, AM_INDUCER, BAGGING_INDUCER, BOOSTER_INDUCER, C45_INDUCER, C45AP_INDUCER, C45R_INDUCER, C50_INDUCER, CART_INDUCER, CatDT_INDUCER, CF_INDUCER, CLUSTER_INDUCER, CN2_INDUCER, CONST_INDUCER, COODG_INDUCER, DDT_INDUCER, DF_INDUCER, DISC_NB_INDUCER, DISC_SEARCH_INDUCER, DISC_TAB_INDUCER, ENTROPY_ODG_INDUCER, FCF_INDUCER, FSS_INDUCER, getEnv, HOODG_INDUCER, IB_INDUCER, ID3_INDUCER, LAZY_DT_INDUCER, LIST_HOODG_INDUCER, LIST_ODG_INDUCER, logOptions, NAIVE_BAYES_INDUCER, NULL_INDUCER, OC1_INDUCER, ODT_INDUCER, ONER_INDUCER, OODG_INDUCER, ORDER_FSS_INDUCER, PEBLS_INDUCER, PERCEPTRON_INDUCER, PERF_EST_INDUCER, PROJECT_INDUCER, RIPPER_INDUCER, SGI_DT_INDUCER, STACKING_INDUCER, T2_INDUCER, TABLE_CAS_INDUCER, TABLE_INDUCER, TDDT_INDUCER, TS, WEIGHT_SEARCH_INDUCER, WINNOW_INDUCER
 
Constructor Summary
Inducer(Inducer source)
          Copy constructor.
Inducer(java.lang.String description)
          Constructor.
 
Method Summary
 boolean can_cast_to_inducer()
          Checks if this Inducer object can be cast to an Inducer.
 Inducer cast_to_inducer()
          Casts this object to an Inducer class.
 void display_struct()
          Displays the structure of the categorizer that is produced by the induction algorithm.
 void display_struct(java.io.BufferedWriter stream, DisplayPref dp)
          Displays the structure of the categorizer that is produced by the induction algorithm.
abstract  Categorizer get_categorizer()
          Returns the categorizer created by this inducer.
 CatTestResult project_train_and_perf_files(java.lang.String fileStem, boolean[] bitString)
          Reads the training and test files in, trains the inducer, and tests the inducer on the attributes specified by the bit string input.
 CatTestResult project_train_and_perf_files(java.lang.String fileStem, java.lang.String namesExtension, boolean[] bitString)
          Reads the training and test files in, trains the inducer, and tests the inducer on the attributes specified by the bit string input.
 CatTestResult project_train_and_perf_files(java.lang.String fileStem, java.lang.String namesExtension, java.lang.String dataExtension, boolean[] bitString)
          Reads the training and test files in, trains the inducer, and tests the inducer on the attributes specified by the bit string input.
 CatTestResult project_train_and_perf_files(java.lang.String fileStem, java.lang.String namesExtension, java.lang.String dataExtension, java.lang.String testExtension, boolean[] bitString)
          Reads the training and test files in, trains the inducer, and tests the inducer on the attributes specified by the bit string input.
 CatTestResult project_train_and_perf(InstanceList trainingSet, InstanceList testSet, boolean[] bitString)
          Train and tests this inducer on the attributes specified.
 double project_train_and_test_files(java.lang.String fileStem, boolean[] bitString)
          Reads the training and test files in, trains the inducer, and tests the inducer on the attributes specified by the bit string input.
 double project_train_and_test_files(java.lang.String fileStem, java.lang.String namesExtension, boolean[] bitString)
          Reads the training and test files in, trains the inducer, and tests the inducer on the attributes specified by the bit string input.
 double project_train_and_test_files(java.lang.String fileStem, java.lang.String namesExtension, java.lang.String dataExtension, boolean[] bitString)
          Reads the training and test files in, trains the inducer, and tests the inducer on the attributes specified by the bit string input.
 double project_train_and_test_files(java.lang.String fileStem, java.lang.String namesExtension, java.lang.String dataExtension, java.lang.String testExtension, boolean[] bitString)
          Reads the training and test files in, trains the inducer, and tests the inducer on the attributes specified by the bit string input.
 double project_train_and_test(InstanceList trainingSet, InstanceList testSet, boolean[] bitString)
          Train and tests this inducer on the attributes specified.
abstract  Categorizer release_categorizer()
          Returns the Categorizer trained and removes ownership by this Inducer object.
 boolean supports_full_testing()
          Checks if this inducer can test itself.
 CatTestResult train_and_perf(InstanceList trainingSet, InstanceList testSet)
          Train and measures performance on the inducer.
 double train_and_test(InstanceList trainingSet, InstanceList testSet)
          Train and tests this inducer.
abstract  void train()
          Trains this inducer on the data set.
 
Methods inherited from class shared.BaseInducer
assign_data, can_cast_to_incr_inducer, cast_to_incr_inducer, class_id, description, get_log_level, get_log_options, get_log_stream, has_data, has_data, instance_list, normalize_weights, read_data, read_data, read_data, release_data, set_log_level, set_log_options, set_log_prefixes, set_log_stream, train_and_test_files, train_and_test_files, train_and_test_files, train_and_test_files
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Inducer

public Inducer(java.lang.String description)
Constructor. Uses the constructor provided in BaseInducer.
Parameters:
description - A String representing the description of the inducer.

Inducer

public Inducer(Inducer source)
Copy constructor.
Parameters:
source - The original inducer that is being copied.
Method Detail

train

public abstract void train()
Trains this inducer on the data set.

get_categorizer

public abstract Categorizer get_categorizer()
Returns the categorizer created by this inducer.
Returns:
The Categorizer class storing a categorizer created by this induction algorithm.

display_struct

public void display_struct()
Displays the structure of the categorizer that is produced by the induction algorithm. Uses default display preferences and System.out for displaying.

display_struct

public void display_struct(java.io.BufferedWriter stream,
                           DisplayPref dp)
Displays the structure of the categorizer that is produced by the induction algorithm.
Parameters:
stream - The output writer used to display the categorizer.
dp - The display preferences specified by caller.

train_and_test

public double train_and_test(InstanceList trainingSet,
                             InstanceList testSet)
Train and tests this inducer. Uses the train_and_perf method, so this method will be specific to the induction algorithm of the subclass.
Overrides:
train_and_test in class BaseInducer
Parameters:
trainingSet - The data set used to train this inducer.
testSet - The data set used to test this inducer.
Returns:
The probability of incorrect responses obtained during testing. Possible values range from 0.0 to 1.0.

train_and_perf

public CatTestResult train_and_perf(InstanceList trainingSet,
                                    InstanceList testSet)
Train and measures performance on the inducer. Uses the train method, so this method will be specific to the induction algorithm of the subclass.
Overrides:
train_and_perf in class BaseInducer
Parameters:
trainingSet - The data set used to train this inducer.
testSet - The data set used to test this inducer.
Returns:
A CatTestResult class that represents the results after perfecting.

supports_full_testing

public boolean supports_full_testing()
Checks if this inducer can test itself.
Overrides:
supports_full_testing in class BaseInducer
Returns:
True for the Inducer class.

project_train_and_test

public double project_train_and_test(InstanceList trainingSet,
                                     InstanceList testSet,
                                     boolean[] bitString)
Train and tests this inducer on the attributes specified. Uses the train_and_perf method, so this method will be specific to the induction algorithm of the subclass.
Parameters:
trainingSet - The data set used to train this inducer.
testSet - The data set used to test this inducer.
bitString - A boolean array with the same number of values as there are attributes. Each boolean element corresponds to an attribute in the order they were input. True values represent attributes that are used.
Returns:
The probability of incorrect responses obtained during testing. Possible values range from 0.0 to 1.0.

project_train_and_test_files

public double project_train_and_test_files(java.lang.String fileStem,
                                           boolean[] bitString)
Reads the training and test files in, trains the inducer, and tests the inducer on the attributes specified by the bit string input.
Parameters:
fileStem - The name of the names, data, and test files without the the file extensions.
bitString - A boolean array with the same number of values as there are attributes. Each boolean element corresponds to an attribute in the order they were input. True values represent attributes that are used.
Returns:
The probability of incorrect test responses. Possible values are 0.0 to 1.0.

project_train_and_test_files

public double project_train_and_test_files(java.lang.String fileStem,
                                           java.lang.String namesExtension,
                                           boolean[] bitString)
Reads the training and test files in, trains the inducer, and tests the inducer on the attributes specified by the bit string input.
Parameters:
fileStem - The name of the names, data, and test files without the the file extensions.
namesExtension - The extension used for the names file. Should begin with a period.
bitString - A boolean array with the same number of values as there are attributes. Each boolean element corresponds to an attribute in the order they were input. True values represent attributes that are used.
Returns:
The probability of incorrect test responses. Possible values are 0.0 to 1.0.

project_train_and_test_files

public double project_train_and_test_files(java.lang.String fileStem,
                                           java.lang.String namesExtension,
                                           java.lang.String dataExtension,
                                           boolean[] bitString)
Reads the training and test files in, trains the inducer, and tests the inducer on the attributes specified by the bit string input.
Parameters:
fileStem - The name of the names, data, and test files without the the file extensions.
namesExtension - The extension used for the names file. Should begin with a period.
dataExtension - The extension used for the data file. Should begin with a period.
bitString - A boolean array with the same number of values as there are attributes. Each boolean element corresponds to an attribute in the order they were input. True values represent attributes that are used.
Returns:
The probability of incorrect test responses. Possible values are 0.0 to 1.0.

project_train_and_test_files

public double project_train_and_test_files(java.lang.String fileStem,
                                           java.lang.String namesExtension,
                                           java.lang.String dataExtension,
                                           java.lang.String testExtension,
                                           boolean[] bitString)
Reads the training and test files in, trains the inducer, and tests the inducer on the attributes specified by the bit string input.
Parameters:
fileStem - The name of the names, data, and test files without the the file extensions.
namesExtension - The extension used for the names file. Should begin with a period.
dataExtension - The extension used for the data file. Should begin with a period.
testExtension - The extension used for the test file. Should begin with a period.
bitString - A boolean array with the same number of values as there are attributes. Each boolean element corresponds to an attribute in the order they were input. True values represent attributes that are used.
Returns:
The probability of incorrect test responses. Possible values are 0.0 to 1.0.

project_train_and_perf

public CatTestResult project_train_and_perf(InstanceList trainingSet,
                                            InstanceList testSet,
                                            boolean[] bitString)
Train and tests this inducer on the attributes specified. Uses the train_and_perf method, so this method will be specific to the induction algorithm of the subclass.
Parameters:
trainingSet - The data set used to train this inducer.
testSet - The data set used to test this inducer.
bitString - A boolean array with the same number of values as there are attributes. Each boolean element corresponds to an attribute in the order they were input. True values represent attributes that are used.
Returns:
The CatTestResult object containing results for this inducer.

project_train_and_perf_files

public CatTestResult project_train_and_perf_files(java.lang.String fileStem,
                                                  java.lang.String namesExtension,
                                                  java.lang.String dataExtension,
                                                  java.lang.String testExtension,
                                                  boolean[] bitString)
Reads the training and test files in, trains the inducer, and tests the inducer on the attributes specified by the bit string input.
Parameters:
fileStem - The name of the names, data, and test files without the the file extensions.
namesExtension - The extension used for the names file. Should begin with a period.
dataExtension - The extension used for the data file. Should begin with a period.
testExtension - The extension used for the test file. Should begin with a period.
bitString - A boolean array with the same number of values as there are attributes. Each boolean element corresponds to an attribute in the order they were input. True values represent attributes that are used.
Returns:
The CatTestResult object containing results for this inducer.

project_train_and_perf_files

public CatTestResult project_train_and_perf_files(java.lang.String fileStem,
                                                  boolean[] bitString)
Reads the training and test files in, trains the inducer, and tests the inducer on the attributes specified by the bit string input.
Parameters:
fileStem - The name of the names, data, and test files without the the file extensions.
bitString - A boolean array with the same number of values as there are attributes. Each boolean element corresponds to an attribute in the order they were input. True values represent attributes that are used.
Returns:
The CatTestResult object containing results for this inducer.

project_train_and_perf_files

public CatTestResult project_train_and_perf_files(java.lang.String fileStem,
                                                  java.lang.String namesExtension,
                                                  boolean[] bitString)
Reads the training and test files in, trains the inducer, and tests the inducer on the attributes specified by the bit string input.
Parameters:
fileStem - The name of the names, data, and test files without the the file extensions.
namesExtension - The extension used for the names file. Should begin with a period.
bitString - A boolean array with the same number of values as there are attributes. Each boolean element corresponds to an attribute in the order they were input. True values represent attributes that are used.
Returns:
The CatTestResult object containing results for this inducer.

project_train_and_perf_files

public CatTestResult project_train_and_perf_files(java.lang.String fileStem,
                                                  java.lang.String namesExtension,
                                                  java.lang.String dataExtension,
                                                  boolean[] bitString)
Reads the training and test files in, trains the inducer, and tests the inducer on the attributes specified by the bit string input.
Parameters:
fileStem - The name of the names, data, and test files without the the file extensions.
namesExtension - The extension used for the names file. Should begin with a period.
dataExtension - The extension used for the data file. Should begin with a period.
bitString - A boolean array with the same number of values as there are attributes. Each boolean element corresponds to an attribute in the order they were input. True values represent attributes that are used.
Returns:
The probability of incorrect test responses. Possible values are 0.0 to 1.0.

release_categorizer

public abstract Categorizer release_categorizer()
Returns the Categorizer trained and removes ownership by this Inducer object.
Returns:
The Categorizer trained.

can_cast_to_inducer

public boolean can_cast_to_inducer()
Checks if this Inducer object can be cast to an Inducer.
Overrides:
can_cast_to_inducer in class BaseInducer
Returns:
TRUE if this object can be cast to an Inducer, FALSE otherwise.

cast_to_inducer

public Inducer cast_to_inducer()
Casts this object to an Inducer class.
Overrides:
cast_to_inducer in class BaseInducer
Returns:
Returns an Inducer reference to this object.