public class InputMappedClassifier extends SingleClassifierEnhancer implements java.io.Serializable, OptionHandler, Drawable, WeightedInstancesHandler, AdditionalMeasureProducer, EnvironmentHandler
-I Ignore case when matching attribute names and nominal values.
-M Suppress the output of the mapping report.
-trim Trim white space from either end of names before matching.
-L <path to model to load> Path to a model to load. If set, this model will be used for prediction and any base classifier specification will be ignored. Environment variables may be used in the path (e.g. ${HOME}/myModel.model)
-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.rules.ZeroR)
Options specific to classifier weka.classifiers.rules.ZeroR:
-D If set, classifier is run in debug mode and may output additional info to the console
BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT
BayesNet, Newick, NOT_DRAWABLE, TREE
Constructor and Description |
---|
InputMappedClassifier() |
Modifier and Type | Method and Description |
---|---|
void |
buildClassifier(Instances data)
Build the classifier
|
double |
classifyInstance(Instance inst)
Classifies the given test instance.
|
Instance |
constructMappedInstance(Instance incoming) |
double[] |
distributionForInstance(Instance inst)
Predicts the class memberships for a given instance.
|
java.util.Enumeration<java.lang.String> |
enumerateMeasures()
Returns an enumeration of the additional measure names
|
Capabilities |
getCapabilities()
Returns default capabilities of the classifier.
|
boolean |
getIgnoreCaseForNames()
Get whether to ignore case when matching attribute names and nominal
values.
|
int |
getMappedClassIndex() |
double |
getMeasure(java.lang.String additionalMeasureName)
Returns the value of the named measure
|
Instances |
getModelHeader(Instances defaultH)
Return the instance structure that the encapsulated model was built with.
|
java.lang.String |
getModelPath()
Get the path used for loading a model.
|
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier.
|
java.lang.String |
getRevision()
Returns the revision string.
|
boolean |
getSuppressMappingReport()
Get whether to suppress output the report of model to input mappings.
|
boolean |
getTrim()
Get whether to trim white space from each end of names before matching.
|
java.lang.String |
globalInfo()
Returns a string describing this classifier
|
java.lang.String |
graph()
Returns graph describing the classifier (if possible).
|
int |
graphType()
Returns the type of graph this classifier represents.
|
java.lang.String |
ignoreCaseForNamesTipText()
Returns the tip text for this property
|
java.util.Enumeration<Option> |
listOptions()
Returns an enumeration describing the available options.
|
static void |
main(java.lang.String[] argv)
Main method for testing this class.
|
java.lang.String |
modelPathTipText()
Returns the tip text for this property
|
void |
setEnvironment(Environment env)
Set the environment variables to use
|
void |
setIgnoreCaseForNames(boolean ignore)
Set whether to ignore case when matching attribute names and nominal
values.
|
void |
setModelHeader(Instances modelHeader)
Set the structure of the data used to create the model.
|
void |
setModelPath(java.lang.String modelPath)
Set the path from which to load a model.
|
void |
setOptions(java.lang.String[] options)
Parses a given list of options.
|
void |
setSuppressMappingReport(boolean suppress)
Set whether to suppress output the report of model to input mappings.
|
void |
setTestStructure(Instances testStructure)
Set the test structure (if known in advance) that we are likely to see.
|
void |
setTrim(boolean trim)
Set whether to trim white space from each end of names before matching.
|
java.lang.String |
suppressMappingReportTipText()
Returns the tip text for this property
|
java.lang.String |
toString() |
java.lang.String |
trimTipText()
Returns the tip text for this property
|
classifierTipText, 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 java.lang.String globalInfo()
public void setEnvironment(Environment env)
setEnvironment
in interface EnvironmentHandler
env
- the environment variables to usepublic java.lang.String ignoreCaseForNamesTipText()
public void setIgnoreCaseForNames(boolean ignore)
ignore
- true if case is to be ignoredpublic boolean getIgnoreCaseForNames()
public java.lang.String trimTipText()
public void setTrim(boolean trim)
trim
- true to trim white space.public boolean getTrim()
public java.lang.String suppressMappingReportTipText()
public void setSuppressMappingReport(boolean suppress)
suppress
- true to suppress this output.public boolean getSuppressMappingReport()
public java.lang.String modelPathTipText()
public void setModelPath(java.lang.String modelPath) throws java.lang.Exception
modelPath
- the path to the model to load.java.lang.Exception
- if a problem occurs during loading.public java.lang.String getModelPath()
public Capabilities getCapabilities()
getCapabilities
in interface Classifier
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class SingleClassifierEnhancer
Capabilities
public java.util.Enumeration<Option> listOptions()
-I Ignore case when matching attribute names and nominal values.
-M Suppress the output of the mapping report.
-trim Trim white space from either end of names before matching.
-L <path to model to load> Path to a model to load. If set, this model will be used for prediction and any base classifier specification will be ignored. Environment variables may be used in the path (e.g. ${HOME}/myModel.model)
-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.rules.ZeroR)
Options specific to classifier weka.classifiers.rules.ZeroR:
-D If set, classifier is run in debug mode and may output additional info to the console
listOptions
in interface OptionHandler
listOptions
in class SingleClassifierEnhancer
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-I Ignore case when matching attribute names and nominal values.
-M Suppress the output of the mapping report.
-trim Trim white space from either end of names before matching.
-L <path to model to load> Path to a model to load. If set, this model will be used for prediction and any base classifier specification will be ignored. Environment variables may be used in the path (e.g. ${HOME}/myModel.model)
-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.rules.ZeroR)
Options specific to classifier weka.classifiers.rules.ZeroR:
-D If set, classifier is run in debug mode and may output additional info to the consoleOptions after -- are passed to the designated classifier.
setOptions
in interface OptionHandler
setOptions
in class SingleClassifierEnhancer
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 SingleClassifierEnhancer
public void setTestStructure(Instances testStructure)
testStructure
- the structure of the test instances that we are likely
to see (if known in advance)public void setModelHeader(Instances modelHeader)
modelHeader
- the structure of the data used to build the wrapped
modelpublic void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in interface Classifier
data
- the training data to be used for generating the bagged
classifier.java.lang.Exception
- if the classifier could not be built successfullypublic Instances getModelHeader(Instances defaultH) throws java.lang.Exception
defaultH
- the default instances structurejava.lang.Exception
- if a problem occurspublic int getMappedClassIndex() throws java.lang.Exception
java.lang.Exception
public Instance constructMappedInstance(Instance incoming) throws java.lang.Exception
java.lang.Exception
public double classifyInstance(Instance inst) throws java.lang.Exception
AbstractClassifier
classifyInstance
in interface Classifier
classifyInstance
in class AbstractClassifier
inst
- the instance to be classifiedjava.lang.Exception
- if an error occurred during the predictionpublic double[] distributionForInstance(Instance inst) throws java.lang.Exception
AbstractClassifier
distributionForInstance
in interface Classifier
distributionForInstance
in class AbstractClassifier
inst
- the instance to be classifiedjava.lang.Exception
- if distribution could not be computed successfullypublic java.lang.String toString()
toString
in class java.lang.Object
public int graphType()
public java.util.Enumeration<java.lang.String> enumerateMeasures()
enumerateMeasures
in interface AdditionalMeasureProducer
public double getMeasure(java.lang.String additionalMeasureName)
getMeasure
in interface AdditionalMeasureProducer
additionalMeasureName
- the name of the measure to query for its valuejava.lang.IllegalArgumentException
- if the named measure is not supportedpublic java.lang.String graph() throws 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
- should contain the following arguments: -t training file [-T
test file] [-c class index]