public class RandomSubSpace extends RandomizableParallelIteratedSingleClassifierEnhancer implements WeightedInstancesHandler, TechnicalInformationHandler
@article{Ho1998, author = {Tin Kam Ho}, journal = {IEEE Transactions on Pattern Analysis and Machine Intelligence}, number = {8}, pages = {832-844}, title = {The Random Subspace Method for Constructing Decision Forests}, volume = {20}, year = {1998}, ISSN = {0162-8828}, URL = {http://citeseer.ist.psu.edu/ho98random.html} }Valid options are:
-P Size of each subspace: < 1: percentage of the number of attributes >=1: absolute number of attributes
-S <num> Random number seed. (default 1)
-I <num> Number of iterations. (default 10)
-D If set, classifier is run in debug mode and may output additional info to the console
-W Full name of base classifier. (default: weka.classifiers.trees.REPTree)
Options specific to classifier weka.classifiers.trees.REPTree:
-M <minimum number of instances> Set minimum number of instances per leaf (default 2).
-V <minimum variance for split> Set minimum numeric class variance proportion of train variance for split (default 1e-3).
-N <number of folds> Number of folds for reduced error pruning (default 3).
-S <seed> Seed for random data shuffling (default 1).
-P No pruning.
-L Maximum tree depth (default -1, no maximum)Options after -- are passed to the designated classifier.
BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT
Constructor and Description |
---|
RandomSubSpace()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
batchSizeTipText()
Tool tip text for this property
|
void |
buildClassifier(Instances data)
builds the classifier.
|
double[] |
distributionForInstance(Instance instance)
Calculates the class membership probabilities for the given test
instance.
|
double[][] |
distributionsForInstances(Instances insts)
Batch scoring method.
|
java.lang.String |
getBatchSize()
Gets the preferred batch size from the base learner if it implements
BatchPredictor.
|
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier.
|
java.lang.String |
getRevision()
Returns the revision string.
|
double |
getSubSpaceSize()
Gets the size of each subSpace, as a percentage of the training set size.
|
TechnicalInformation |
getTechnicalInformation()
Returns an instance of a TechnicalInformation object, containing
detailed information about the technical background of this class,
e.g., paper reference or book this class is based on.
|
java.lang.String |
globalInfo()
Returns a string describing classifier
|
boolean |
implementsMoreEfficientBatchPrediction()
Returns true if the base classifier implements BatchPredictor and is able
to generate batch predictions efficiently
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] args)
Main method for testing this class.
|
void |
setBatchSize(java.lang.String size)
Set the batch size to use.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setSubSpaceSize(double value)
Sets the size of each subSpace, as a percentage of the training set size.
|
java.lang.String |
subSpaceSizeTipText()
Returns the tip text for this property
|
java.lang.String |
toString()
Returns description of the bagged classifier.
|
getSeed, seedTipText, setSeed
getNumExecutionSlots, numExecutionSlotsTipText, setNumExecutionSlots
getNumIterations, numIterationsTipText, setNumIterations
classifierTipText, getCapabilities, getClassifier, postExecution, preExecution, setClassifier
classifyInstance, debugTipText, doNotCheckCapabilitiesTipText, forName, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, makeCopies, makeCopy, numDecimalPlacesTipText, run, runClassifier, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public java.lang.String globalInfo()
public TechnicalInformation getTechnicalInformation()
getTechnicalInformation
in interface TechnicalInformationHandler
public java.util.Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
listOptions
in class RandomizableParallelIteratedSingleClassifierEnhancer
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-P Size of each subspace: < 1: percentage of the number of attributes >=1: absolute number of attributes
-S <num> Random number seed. (default 1)
-I <num> Number of iterations. (default 10)
-D If set, classifier is run in debug mode and may output additional info to the console
-W Full name of base classifier. (default: weka.classifiers.trees.REPTree)
Options specific to classifier weka.classifiers.trees.REPTree:
-M <minimum number of instances> Set minimum number of instances per leaf (default 2).
-V <minimum variance for split> Set minimum numeric class variance proportion of train variance for split (default 1e-3).
-N <number of folds> Number of folds for reduced error pruning (default 3).
-S <seed> Seed for random data shuffling (default 1).
-P No pruning.
-L Maximum tree depth (default -1, no maximum)Options after -- are passed to the designated classifier.
setOptions
in interface OptionHandler
setOptions
in class RandomizableParallelIteratedSingleClassifierEnhancer
options
- the list of options as an array of stringsjava.lang.Exception
- if an option is not supportedpublic java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class RandomizableParallelIteratedSingleClassifierEnhancer
public java.lang.String subSpaceSizeTipText()
public double getSubSpaceSize()
public void setSubSpaceSize(double value)
value
- the subSpace size, as a percentage.public void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in interface Classifier
buildClassifier
in class ParallelIteratedSingleClassifierEnhancer
data
- the training data to be used for generating the
classifier.java.lang.Exception
- if the classifier could not be built successfullypublic double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in interface Classifier
distributionForInstance
in class AbstractClassifier
instance
- the instance to be classifiedjava.lang.Exception
- if distribution can't be computed successfullypublic java.lang.String batchSizeTipText()
batchSizeTipText
in class AbstractClassifier
public void setBatchSize(java.lang.String size)
setBatchSize
in interface BatchPredictor
setBatchSize
in class AbstractClassifier
size
- the batch size to usepublic java.lang.String getBatchSize()
getBatchSize
in interface BatchPredictor
getBatchSize
in class AbstractClassifier
public double[][] distributionsForInstances(Instances insts) throws java.lang.Exception
distributionsForInstances
in interface BatchPredictor
distributionsForInstances
in class AbstractClassifier
insts
- the instances to get predictions forjava.lang.Exception
- if a problem occurspublic boolean implementsMoreEfficientBatchPrediction()
implementsMoreEfficientBatchPrediction
in interface BatchPredictor
implementsMoreEfficientBatchPrediction
in class AbstractClassifier
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClassifier
public static void main(java.lang.String[] args)
args
- the options