public class SerializedClassifier extends AbstractClassifier
-D If set, classifier is run in debug mode and may output additional info to the console
-model <filename> The file containing the serialized model. (required)
BATCH_SIZE_DEFAULT, NUM_DECIMAL_PLACES_DEFAULT
Constructor and Description |
---|
SerializedClassifier() |
Modifier and Type | Method and Description |
---|---|
void |
buildClassifier(Instances data)
loads only the serialized classifier
|
double[] |
distributionForInstance(Instance instance)
Calculates the class membership probabilities for the given test instance.
|
Capabilities |
getCapabilities()
Returns default capabilities of the base classifier.
|
Classifier |
getCurrentModel()
Gets the currently loaded model (can be null).
|
java.io.File |
getModelFile()
Gets the file containing the serialized model.
|
java.lang.String[] |
getOptions()
returns the options of the current setup
|
java.lang.String |
getRevision()
Returns the revision string.
|
java.lang.String |
globalInfo()
Returns a string describing classifier
|
java.util.Enumeration<Option> |
listOptions()
Gets an enumeration describing the available options.
|
static void |
main(java.lang.String[] args)
Runs the classifier with the given options
|
java.lang.String |
modelFileTipText()
Returns the tip text for this property
|
void |
setModel(Classifier value)
Sets the fully built model to use, if one doesn't want to load a model from
a file or already deserialized a model from somewhere else.
|
void |
setModelFile(java.io.File value)
Sets the file containing the serialized model.
|
void |
setOptions(java.lang.String[] options)
Parses the options for this object.
|
java.lang.String |
toString()
Returns a string representation of the classifier
|
batchSizeTipText, classifyInstance, debugTipText, distributionsForInstances, doNotCheckCapabilitiesTipText, forName, getBatchSize, getDebug, getDoNotCheckCapabilities, getNumDecimalPlaces, implementsMoreEfficientBatchPrediction, makeCopies, makeCopy, numDecimalPlacesTipText, postExecution, preExecution, run, runClassifier, setBatchSize, setDebug, setDoNotCheckCapabilities, setNumDecimalPlaces
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
makeCopy
public java.lang.String globalInfo()
public java.util.Enumeration<Option> listOptions()
listOptions
in interface OptionHandler
listOptions
in class AbstractClassifier
public java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class AbstractClassifier
public void setOptions(java.lang.String[] options) throws java.lang.Exception
-D If set, classifier is run in debug mode and may output additional info to the console
-model <filename> The file containing the serialized model. (required)
setOptions
in interface OptionHandler
setOptions
in class AbstractClassifier
options
- the options to usejava.lang.Exception
- if setting of options failspublic java.lang.String modelFileTipText()
public java.io.File getModelFile()
public void setModelFile(java.io.File value)
value
- the file.public void setModel(Classifier value)
value
- the built modelgetCurrentModel()
public Classifier getCurrentModel()
setModel(Classifier)
public Capabilities getCapabilities()
getCapabilities
in interface Classifier
getCapabilities
in interface CapabilitiesHandler
getCapabilities
in class AbstractClassifier
Capabilities
public 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 void buildClassifier(Instances data) throws java.lang.Exception
data
- the training instancesjava.lang.Exception
- if something goes wrongpublic 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 commandline options