|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gate.creole.ml.weka.Wrapper
Wrapper class for the WEKA Machine Learning Engine.
Nested Class Summary | |
protected class |
Wrapper.LoadModelAction
|
protected class |
Wrapper.SaveDatasetAsArffAction
|
protected class |
Wrapper.SaveModelAction
|
Field Summary | |
protected List |
actionsList
|
protected weka.classifiers.Classifier |
classifier
The WEKA classifier used by this wrapper |
(package private) double |
confidenceThreshold
|
protected weka.core.Instances |
dataset
The dataset used for training |
protected boolean |
datasetChanged
Marks whether the dataset was changed since the last time the classifier was built. |
protected DatasetDefintion |
datasetDefinition
|
protected org.jdom.Element |
optionsElement
The JDom element contaning the options fro this wrapper. |
protected ProcessingResource |
owner
|
protected StatusListener |
sListener
|
Constructor Summary | |
Wrapper()
|
Method Summary | |
void |
addTrainingInstance(List attributeValues)
Adds a new training instance to the dataset. |
protected weka.core.Instance |
buildInstance(List attributeValues)
Constructs an instance valid for the current dataset from a list of attribute values. |
Object |
classifyInstance(List attributeValues)
Classifies a new instance. |
protected Object |
convertAttributeValue(double value)
|
List |
getActions()
Gets the list of actions that can be performed on this resource. |
void |
init()
Initialises the classifier and prepares for running. |
protected void |
load(InputStream is)
Loads the state of this engine from previously saved data. |
protected void |
save(OutputStream os)
Saves the state of the engine for reuse at a later time. |
void |
setDatasetDefinition(DatasetDefintion definition)
Sets the definition for the dataset used. |
void |
setOptions(org.jdom.Element optionsElem)
Sets the options from an XML JDom element. |
void |
setOwnerPR(ProcessingResource pr)
Registers the PR using the engine with the engine itself. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected DatasetDefintion datasetDefinition
double confidenceThreshold
protected weka.classifiers.Classifier classifier
protected weka.core.Instances dataset
protected org.jdom.Element optionsElement
protected boolean datasetChanged
protected List actionsList
protected ProcessingResource owner
protected StatusListener sListener
Constructor Detail |
public Wrapper()
Method Detail |
public void setOptions(org.jdom.Element optionsElem)
MLEngine
setOptions
in interface MLEngine
optionsElem
- the JDom element containing the options from the
configuration.public void addTrainingInstance(List attributeValues) throws ExecutionException
MLEngine
addTrainingInstance
in interface MLEngine
attributeValues
- the list of attributes describing the instance. The
elements in the list are String values that need to be interpreted
according to the dataset definition: for nominal attributes the values will
used as they are; for numeric attributes the values will be converted to
double.
ExecutionException
protected weka.core.Instance buildInstance(List attributeValues) throws ExecutionException
attributeValues
- the values for the attributes.
Instance
value.
ExecutionException
public void setDatasetDefinition(DatasetDefintion definition)
MLEngine
setDatasetDefinition
in interface MLEngine
definition
- public Object classifyInstance(List attributeValues) throws ExecutionException
MLEngine
classifyInstance
in interface MLEngine
attributeValues
- the list of attributes describing the instance. The
elements in the list are Object values that need to be interpreted
according to the dataset definition. The value for the class element will
be arbitrary.
ExecutionException
protected Object convertAttributeValue(double value)
public void init() throws GateException
init
in interface MLEngine
GateException
protected void load(InputStream is) throws IOException
is
-
IOException
protected void save(OutputStream os) throws IOException
os
-
IOException
public List getActions()
getActions
in interface ActionsPublisher
public void setOwnerPR(ProcessingResource pr)
setOwnerPR
in interface MLEngine
pr
- the processing resource that owns this engine.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |