|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.classifiers.Classifier
weka.classifiers.misc.SerializedClassifier
public class SerializedClassifier
A wrapper around a serialized classifier model. This classifier loads a serialized models and uses it to make predictions.
Warning: since the serialized model doesn't get changed, cross-validation cannot bet used with this 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 Summary | |
|---|---|
SerializedClassifier()
|
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class weka.classifiers.Classifier |
|---|
classifyInstance, debugTipText, forName, getDebug, makeCopies, makeCopy, setDebug |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SerializedClassifier()
| Method Detail |
|---|
public java.lang.String globalInfo()
public java.util.Enumeration listOptions()
listOptions in interface OptionHandlerlistOptions in class Classifierpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlergetOptions 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 OptionHandlersetOptions in class Classifieroptions - the options to use
java.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 CapabilitiesHandlergetCapabilities in class ClassifierCapabilities
public double[] distributionForInstance(Instance instance)
throws java.lang.Exception
distributionForInstance in class Classifierinstance - the instance to be classified
java.lang.Exception - if distribution can't be computed successfully
public void buildClassifier(Instances data)
throws java.lang.Exception
buildClassifier in class Classifierdata - the training instances
java.lang.Exception - if something goes wrongpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class Classifierpublic static void main(java.lang.String[] args)
args - the commandline options
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||