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_DEFAULTBayesNet, 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, setClassifierbatchSizeTipText, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlacespublic java.lang.String globalInfo()
public void setEnvironment(Environment env)
setEnvironment in interface EnvironmentHandlerenv - 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 ClassifiergetCapabilities in interface CapabilitiesHandlergetCapabilities in class SingleClassifierEnhancerCapabilitiespublic 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 OptionHandlerlistOptions in class SingleClassifierEnhancerpublic 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 OptionHandlersetOptions in class SingleClassifierEnhanceroptions - the list of options as an array of stringsjava.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlergetOptions in class SingleClassifierEnhancerpublic 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 Classifierdata - 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.Exceptionpublic Instance constructMappedInstance(Instance incoming) throws java.lang.Exception
java.lang.Exceptionpublic double classifyInstance(Instance inst) throws java.lang.Exception
AbstractClassifierclassifyInstance in interface ClassifierclassifyInstance in class AbstractClassifierinst - the instance to be classifiedjava.lang.Exception - if an error occurred during the predictionpublic double[] distributionForInstance(Instance inst) throws java.lang.Exception
AbstractClassifierdistributionForInstance in interface ClassifierdistributionForInstance in class AbstractClassifierinst - the instance to be classifiedjava.lang.Exception - if distribution could not be computed successfullypublic java.lang.String toString()
toString in class java.lang.Objectpublic int graphType()
public java.util.Enumeration<java.lang.String> enumerateMeasures()
enumerateMeasures in interface AdditionalMeasureProducerpublic double getMeasure(java.lang.String additionalMeasureName)
getMeasure in interface AdditionalMeasureProduceradditionalMeasureName - 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 RevisionHandlergetRevision in class AbstractClassifierpublic static void main(java.lang.String[] argv)
argv - should contain the following arguments: -t training file [-T
test file] [-c class index]