|
||||||||||
| 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(Instances instances)
Generates the classifier. |
double |
classifyInstance(Instance instance)
Classifies a given instance. |
double[] |
distributionForInstance(Instance instance)
Calculates the class membership probabilities for the given test instance. |
Capabilities |
getCapabilities()
Returns default capabilities of the classifier. |
java.io.File |
getGroovyModule()
Gets the Groovy module. |
java.lang.String |
getGroovyOptions()
Gets the Groovy module options. |
java.lang.String[] |
getOptions()
Gets the current settings of the Classifier. |
java.lang.String |
getRevision()
Returns the revision string. |
java.lang.String |
globalInfo()
Returns a string describing classifier. |
java.lang.String |
GroovyModuleTipText()
Returns the tip text for this property. |
java.lang.String |
GroovyOptionsTipText()
Returns the tip text for this property. |
java.util.Enumeration |
listOptions()
Returns an enumeration describing the available options. |
static void |
main(java.lang.String[] args)
Main method for testing this class. |
void |
setGroovyModule(java.io.File value)
Sets the Groovy module. |
void |
setGroovyOptions(java.lang.String value)
Sets the Groovy module options. |
void |
setOptions(java.lang.String[] options)
Parses a given list of options. |
java.lang.String |
toString()
Returns a description of the classifier. |
| Methods inherited from class weka.classifiers.AbstractClassifier |
|---|
debugTipText, forName, getDebug, makeCopies, makeCopy, setDebug |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public GroovyClassifier()
| Method Detail |
|---|
public java.lang.String globalInfo()
public java.util.Enumeration listOptions()
listOptions in interface OptionHandlerlistOptions in class AbstractClassifier
public void setOptions(java.lang.String[] options)
throws java.lang.Exception
setOptions in interface OptionHandlersetOptions in class AbstractClassifieroptions - the list of options as an array of strings
java.lang.Exception - if an option is not supportedpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlergetOptions in class AbstractClassifierpublic java.lang.String GroovyModuleTipText()
public void setGroovyModule(java.io.File value)
value - the Groovy modulepublic java.io.File getGroovyModule()
public java.lang.String GroovyOptionsTipText()
public void setGroovyOptions(java.lang.String value)
value - the optionspublic java.lang.String getGroovyOptions()
public Capabilities getCapabilities()
getCapabilities in interface ClassifiergetCapabilities in interface CapabilitiesHandlergetCapabilities in class AbstractClassifierCapabilities
public void buildClassifier(Instances instances)
throws java.lang.Exception
instances - set of instances serving as training data
java.lang.Exception - if the classifier has not been generated successfully
public double classifyInstance(Instance instance)
throws java.lang.Exception
classifyInstance in interface ClassifierclassifyInstance in class AbstractClassifierinstance - the instance to be classified
java.lang.Exception - if an error occurred during the prediction
public double[] distributionForInstance(Instance instance)
throws java.lang.Exception
distributionForInstance in interface ClassifierdistributionForInstance in class AbstractClassifierinstance - the instance to be classified
java.lang.Exception - if class is numericpublic java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class AbstractClassifierpublic static void main(java.lang.String[] args)
args - the options
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||