public class BalancedRandomForest extends AbstractClassifier implements Randomizable
For more information see:
Leo Breiman (2001). Random Forests. Machine Learning. 45(1):5-32.BibTeX:
@article{Breiman2001, author = {Leo Breiman}, journal = {Machine Learning}, number = {1}, pages = {5-32}, title = {Random Forests}, volume = {45}, year = {2001} }*
Valid options are:
-I <number of trees> Number of trees to build.
-K <number of features> Number of features to consider (<1=int(logM+1)).
-S Seed for random number generator. (default 1)
-D If set, classifier is run in debug mode and may output additional info to the console
BATCH_SIZE_DEFAULT, m_BatchSize, m_Debug, m_DoNotCheckCapabilities, m_numDecimalPlaces, NUM_DECIMAL_PLACES_DEFAULT
Constructor and Description |
---|
BalancedRandomForest() |
Modifier and Type | Method and Description |
---|---|
void |
buildClassifier(Instances data)
Build Balanced Random Forest
|
double[] |
distributionForInstance(Instance instance)
Calculates the class membership probabilities for the given test
instance.
|
Enumeration |
enumerateMeasures()
Returns an enumeration of the additional measure names.
|
Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
double |
getMeasure(String additionalMeasureName)
Returns the value of the named measure.
|
int |
getNumFeatures()
Get the number of random features to use
in each node of the random trees.
|
int |
getNumTrees()
Get the number of trees in the forest
|
String[] |
getOptions()
Gets the current settings of the forest.
|
int |
getSeed()
Get the seed used to initialize the
random number generators
|
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.
|
String |
globalInfo()
Returns a string describing classifier
|
static void |
main(String[] argv)
Main method for this class.
|
double |
measureOutOfBagError()
Gets the out of bag error that was calculated as the classifier
was built.
|
String |
numFeaturesTipText()
Returns the tip text for this property
|
String |
numTreesTipText()
Returns the tip text for this property
|
String |
seedTipText()
Returns the tip text for this property
|
void |
setNumFeatures(int numFeatures)
Set the number of random features to use
in each node of the random trees
|
void |
setNumTrees(int numTrees)
Set the number of trees in the forest
|
void |
setOptions(String[] options)
Parses a given list of options.
|
void |
setSeed(int seed)
Set the seed used to initialize the
random number generators
|
String |
toString()
Outputs a description of this classifier.
|
batchSizeTipText, classifyInstance, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, getRevision, implementsMoreEfficientBatchPrediction, listOptions, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public String globalInfo()
public TechnicalInformation getTechnicalInformation()
public String numTreesTipText()
public String numFeaturesTipText()
public String seedTipText()
public void buildClassifier(Instances data) throws Exception
buildClassifier
in interface Classifier
Exception
public double[] distributionForInstance(Instance instance)
distributionForInstance
in interface Classifier
distributionForInstance
in class AbstractClassifier
instance
- the instance to be classifiedpublic String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class AbstractClassifier
public void setOptions(String[] options) throws Exception
Valid options are:
-I <number of trees> Number of trees to build.
-K <number of features> Number of features to consider (<1=int(logM+1)).
-S Seed for random number generator. (default 1)
-D If set, classifier is run in debug mode and may output additional info to the console
setOptions
in interface OptionHandler
setOptions
in class AbstractClassifier
options
- the list of options as an array of stringsException
- if an option is not supportedpublic int getNumFeatures()
public int getNumTrees()
public Capabilities getCapabilities()
getCapabilities
in interface Classifier
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class AbstractClassifier
public int getSeed()
getSeed
in interface Randomizable
public void setSeed(int seed)
setSeed
in interface Randomizable
seed
- random seedpublic void setNumTrees(int numTrees)
numTrees
- number of treespublic void setNumFeatures(int numFeatures)
numFeatures
- number of random featurespublic double measureOutOfBagError()
public Enumeration enumerateMeasures()
public double getMeasure(String additionalMeasureName)
additionalMeasureName
- the name of the measure to query for its valueIllegalArgumentException
- if the named measure is not supportedpublic String toString()
public static void main(String[] argv)
argv
- the optionsCopyright © 2015–2021 Fiji. All rights reserved.