public class SerializedClassifier extends Classifier
-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)
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 |
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
|
classifyInstance, debugTipText, forName, getDebug, makeCopies, makeCopy, setDebug
public java.lang.String globalInfo()
public java.util.Enumeration listOptions()
listOptions
in interface OptionHandler
listOptions
in class Classifier
public java.lang.String[] getOptions()
getOptions
in interface OptionHandler
getOptions
in class Classifier
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 Classifier
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 CapabilitiesHandler
getCapabilities
in class Classifier
Capabilities
public double[] distributionForInstance(Instance instance) throws java.lang.Exception
distributionForInstance
in class Classifier
instance
- the instance to be classifiedjava.lang.Exception
- if distribution can't be computed successfullypublic void buildClassifier(Instances data) throws java.lang.Exception
buildClassifier
in class Classifier
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 Classifier
public static void main(java.lang.String[] args)
args
- the commandline options