public class WeightedInstancesHandlerWrapper extends RandomizableSingleClassifierEnhancer implements WeightedInstancesHandler
-force-resample-with-weights Forces resampling of weights, regardless of whether base classifier handles instance weights
-S <num> Random number seed. (default 1)
-W Full name of base classifier. (default: weka.classifiers.rules.ZeroR)
-output-debug-info If set, classifier is run in debug mode and may output additional info to the console
-do-not-check-capabilities If set, classifier capabilities are not checked before classifier is built (use with caution).
-num-decimal-places The number of decimal places for the output of numbers in the model (default 2).
Options specific to classifier weka.classifiers.rules.ZeroR:
-output-debug-info If set, classifier is run in debug mode and may output additional info to the console
-do-not-check-capabilities If set, classifier capabilities are not checked before classifier is built (use with caution).
-num-decimal-places The number of decimal places for the output of numbers in the model (default 2).
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FORCE_RESAMPLE_WITH_WEIGHTS
command-line option for resampling with weights.
|
BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT
Constructor and Description |
---|
WeightedInstancesHandlerWrapper() |
Modifier and Type | Method and Description |
---|---|
void |
buildClassifier(Instances data)
builds the classifier.
|
double |
classifyInstance(Instance instance)
Classifies the given test instance.
|
double[] |
distributionForInstance(Instance instance)
Calculates the class membership probabilities for the given test
instance.
|
java.lang.String |
forceResampleWithWeightsTipText()
Returns the tip text for this property
|
boolean |
getForceResampleWithWeights()
Gets the size of each subSpace, as a percentage of the training set size.
|
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier.
|
java.lang.String |
getRevision()
Returns the revision string.
|
java.lang.String |
globalInfo()
Returns a string describing classifier
|
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 |
setForceResampleWithWeights(boolean value)
Sets the size of each subSpace, as a percentage of the training set size.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
java.lang.String |
toString()
Returns a string description of the model.
|
getSeed, seedTipText, setSeed
classifierTipText, getCapabilities, getClassifier, postExecution, preExecution, setClassifier
batchSizeTipText, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public static final java.lang.String FORCE_RESAMPLE_WITH_WEIGHTS
public java.lang.String globalInfo()
public java.util.Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
listOptions
in class RandomizableSingleClassifierEnhancer
public void setOptions(java.lang.String[] options) throws java.lang.Exception
setOptions
in interface OptionHandler
setOptions
in class RandomizableSingleClassifierEnhancer
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 RandomizableSingleClassifierEnhancer
public boolean getForceResampleWithWeights()
public void setForceResampleWithWeights(boolean value)
value
- the subSpace size, as a percentage.public java.lang.String forceResampleWithWeightsTipText()
public void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in interface Classifier
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 double classifyInstance(Instance instance) throws java.lang.Exception
classifyInstance
in interface Classifier
classifyInstance
in class AbstractClassifier
instance
- the instance to be classifiedjava.lang.Exception
- if an error occurred during the predictionpublic 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