|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectweka.classifiers.AbstractClassifier
weka.classifiers.scripting.JythonClassifier
public class JythonClassifier
A wrapper class for Jython code. Even though the classifier is serializable, the trained classifier cannot be stored persistently. I.e., one cannot store a model file and re-load it at a later point in time again to make predictions.
Valid options are:-J <filename> The Jython module to load (full path) Options after '--' will be passed on to the Jython module.
-P <directory[,directory,...]> The paths to add to 'sys.path' (comma-separated list).
-D If set, classifier is run in debug mode and may output additional info to the consoleOptions after "--" will be passed onto the Jython module. Partially based on this code.
| Constructor Summary | |
|---|---|
JythonClassifier()
default constructor. |
|
| Method Summary | |
|---|---|
void |
buildClassifier(weka.core.Instances instances)
Generates the classifier. |
double |
classifyInstance(weka.core.Instance instance)
Classifies a given instance. |
double[] |
distributionForInstance(weka.core.Instance instance)
Calculates the class membership probabilities for the given test instance. |
weka.core.Capabilities |
getCapabilities()
Returns default capabilities of the classifier. |
File |
getJythonModule()
Gets the Jython module. |
String |
getJythonOptions()
Gets the Jython module options. |
String |
getJythonPaths()
Gets the additional Jython paths. |
String[] |
getOptions()
Gets the current settings of the Classifier. |
String |
getRevision()
Returns the revision string. |
String |
globalInfo()
Returns a string describing classifier. |
String |
jythonModuleTipText()
Returns the tip text for this property. |
String |
jythonOptionsTipText()
Returns the tip text for this property. |
String |
jythonPathsTipText()
Returns the tip text for this property. |
Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(String[] args)
Main method for testing this class. |
void |
setJythonModule(File value)
Sets the Jython module. |
void |
setJythonOptions(String value)
Sets the Jython module options. |
void |
setJythonPaths(String value)
Sets the additional Jython paths. |
void |
setOptions(String[] options)
Parses a given list of options. |
String |
toString()
Returns a description of the classifier. |
| Methods inherited from class weka.classifiers.AbstractClassifier |
|---|
debugTipText, forName, getDebug, makeCopies, makeCopy, runClassifier, setDebug |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JythonClassifier()
| Method Detail |
|---|
public String globalInfo()
public Enumeration listOptions()
listOptions in interface weka.core.OptionHandlerlistOptions in class weka.classifiers.AbstractClassifier
public void setOptions(String[] options)
throws Exception
setOptions in interface weka.core.OptionHandlersetOptions in class weka.classifiers.AbstractClassifieroptions - the list of options as an array of strings
Exception - if an option is not supportedpublic String[] getOptions()
getOptions in interface weka.core.OptionHandlergetOptions in class weka.classifiers.AbstractClassifierpublic String jythonModuleTipText()
public void setJythonModule(File value)
value - the Jython modulepublic File getJythonModule()
public String jythonOptionsTipText()
public void setJythonOptions(String value)
value - the optionspublic String getJythonOptions()
public String jythonPathsTipText()
public void setJythonPaths(String value)
value - the paths (comma-separated list)public String getJythonPaths()
public weka.core.Capabilities getCapabilities()
getCapabilities in interface weka.classifiers.ClassifiergetCapabilities in interface weka.core.CapabilitiesHandlergetCapabilities in class weka.classifiers.AbstractClassifier
public void buildClassifier(weka.core.Instances instances)
throws Exception
instances - set of instances serving as training data
Exception - if the classifier has not been generated successfully
public double classifyInstance(weka.core.Instance instance)
throws Exception
classifyInstance in interface weka.classifiers.ClassifierclassifyInstance in class weka.classifiers.AbstractClassifierinstance - the instance to be classified
Exception - if an error occurred during the prediction
public double[] distributionForInstance(weka.core.Instance instance)
throws Exception
distributionForInstance in interface weka.classifiers.ClassifierdistributionForInstance in class weka.classifiers.AbstractClassifierinstance - the instance to be classified
Exception - if class is numericpublic String toString()
toString in class Objectpublic String getRevision()
getRevision in interface weka.core.RevisionHandlergetRevision in class weka.classifiers.AbstractClassifierpublic static void main(String[] args)
args - the options
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||