|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectweka.classifiers.AbstractClassifier
weka.classifiers.scripting.GroovyClassifier
public class GroovyClassifier
A wrapper class for Groovy 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:-G <filename> The Groovy module to load (full path) Options after '--' will be passed on to the Groovy module.
-D If set, classifier is run in debug mode and may output additional info to the consoleOptions after "--" will be passed on to the Groovy module. In order to use Groovy, the jar containing all the classes must be present in the CLASSPATH. This jar is normally found in the embeddable sub-directory of the Groovy installation. Tested with Groovy 1.5.7.
Groovy,
Serialized Form| Constructor Summary | |
|---|---|
GroovyClassifier()
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 |
getGroovyModule()
Gets the Groovy module. |
String |
getGroovyOptions()
Gets the Groovy module options. |
String[] |
getOptions()
Gets the current settings of the Classifier. |
String |
getRevision()
Returns the revision string. |
String |
globalInfo()
Returns a string describing classifier. |
String |
GroovyModuleTipText()
Returns the tip text for this property. |
String |
GroovyOptionsTipText()
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 |
setGroovyModule(File value)
Sets the Groovy module. |
void |
setGroovyOptions(String value)
Sets the Groovy module options. |
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 GroovyClassifier()
| 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 GroovyModuleTipText()
public void setGroovyModule(File value)
value - the Groovy modulepublic File getGroovyModule()
public String GroovyOptionsTipText()
public void setGroovyOptions(String value)
value - the optionspublic String getGroovyOptions()
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 | ||||||||