public class RandomCommittee extends RandomizableParallelIteratedSingleClassifierEnhancer implements WeightedInstancesHandler, PartitionGenerator
-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.RandomTree)
Options specific to classifier weka.classifiers.trees.RandomTree:
-K <number of attributes> Number of attributes to randomly investigate (<1 = int(log(#attributes)+1)).
-M <minimum number of instances> Set minimum number of instances per leaf.
-S <num> Seed for random number generator. (default 1)
-depth <num> The maximum depth of the tree, 0 for unlimited. (default 0)
-D If set, classifier is run in debug mode and may output additional info to the consoleOptions after -- are passed to the designated classifier.
BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT
Constructor and Description |
---|
RandomCommittee()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
batchSizeTipText()
Tool tip text for this property
|
void |
buildClassifier(Instances data)
Builds the committee of randomizable classifiers.
|
double[] |
distributionForInstance(Instance instance)
Calculates the class membership probabilities for the given test
instance.
|
double[][] |
distributionsForInstances(Instances insts)
Batch scoring method.
|
void |
generatePartition(Instances data)
Builds the classifier to generate a partition.
|
java.lang.String |
getBatchSize()
Gets the preferred batch size from the base learner if it implements
BatchPredictor.
|
double[] |
getMembershipValues(Instance inst)
Computes an array that indicates leaf membership
|
java.lang.String |
getRevision()
Returns the revision string.
|
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
|
static void |
main(java.lang.String[] argv)
Main method for testing this class.
|
int |
numElements()
Returns the number of elements in the partition.
|
void |
setBatchSize(java.lang.String size)
Set the batch size to use.
|
java.lang.String |
toString()
Returns description of the committee.
|
getOptions, getSeed, listOptions, seedTipText, setOptions, 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
getCapabilities
makeCopy
public java.lang.String globalInfo()
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
bagged 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 void generatePartition(Instances data) throws java.lang.Exception
generatePartition
in interface PartitionGenerator
java.lang.Exception
public double[] getMembershipValues(Instance inst) throws java.lang.Exception
getMembershipValues
in interface PartitionGenerator
java.lang.Exception
public int numElements() throws java.lang.Exception
numElements
in interface PartitionGenerator
java.lang.Exception
public java.lang.String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClassifier
public static void main(java.lang.String[] argv)
argv
- the options