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 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.
|
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.
|
String[] |
getOptions()
Gets the current settings of the Classifier.
|
String |
getRevision()
Returns the revision string.
|
String |
globalInfo()
Returns a string describing classifier
|
Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(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(String[] options)
Parses a given list of options.
|
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
public static final String FORCE_RESAMPLE_WITH_WEIGHTS
public String globalInfo()
public Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
listOptions
in class RandomizableSingleClassifierEnhancer
public void setOptions(String[] options) throws Exception
setOptions
in interface OptionHandler
setOptions
in class RandomizableSingleClassifierEnhancer
options
- the list of options as an array of stringsException
- if an option is not supportedpublic 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 String forceResampleWithWeightsTipText()
public void buildClassifier(Instances data) throws Exception
buildClassifier
in interface Classifier
data
- the training data to be used for generating the
classifier.Exception
- if the classifier could not be built successfullypublic double[] distributionForInstance(Instance instance) throws Exception
distributionForInstance
in interface Classifier
distributionForInstance
in class AbstractClassifier
instance
- the instance to be classifiedException
- if distribution can't be computed successfullypublic double classifyInstance(Instance instance) throws Exception
classifyInstance
in interface Classifier
classifyInstance
in class AbstractClassifier
instance
- the instance to be classifiedException
- if an error occurred during the predictionpublic String toString()
public String getRevision()
getRevision
in interface RevisionHandler
getRevision
in class AbstractClassifier
public static void main(String[] args)
args
- the optionsCopyright © 2018 University of Waikato, Hamilton, NZ. All Rights Reserved.