gate.creole.ml.weka
Class Wrapper

java.lang.Object
  |
  +--gate.creole.ml.weka.Wrapper
All Implemented Interfaces:
ActionsPublisher, MLEngine

public class Wrapper
extends Object
implements MLEngine, ActionsPublisher

Wrapper class for the WEKA Machine Learning Engine.


Constructor Summary
Wrapper()
           
 
Method Summary
 void addTrainingInstance(List attributeValues)
          Adds a new training instance to the dataset.
 Object classifyInstance(List attributeValues)
          Classifies a new instance.
 List getActions()
          Gets the list of actions that can be performed on this resource.
 void init()
          Initialises the classifier and prepares for running.
 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
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Wrapper

public Wrapper()
Method Detail

setOptions

public void setOptions(org.jdom.Element optionsElem)
Description copied from interface: MLEngine
Sets the options from an XML JDom element.

Specified by:
setOptions in interface MLEngine
Parameters:
optionsElem - the JDom element containing the options from the configuration.

addTrainingInstance

public void addTrainingInstance(List attributeValues)
                         throws ExecutionException
Description copied from interface: MLEngine
Adds a new training instance to the dataset.

Specified by:
addTrainingInstance in interface MLEngine
Parameters:
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

setDatasetDefinition

public void setDatasetDefinition(DatasetDefintion definition)
Description copied from interface: MLEngine
Sets the definition for the dataset used.

Specified by:
setDatasetDefinition in interface MLEngine
Parameters:
definition -

classifyInstance

public Object classifyInstance(List attributeValues)
                        throws ExecutionException
Description copied from interface: MLEngine
Classifies a new instance.

Specified by:
classifyInstance in interface MLEngine
Parameters:
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.
Returns:
a String value for nominal and boolean attributes and a Double value for numeric attributes.
ExecutionException

init

public void init()
          throws GateException
Initialises the classifier and prepares for running.

Specified by:
init in interface MLEngine
Throws:
GateException

getActions

public List getActions()
Gets the list of actions that can be performed on this resource.

Specified by:
getActions in interface ActionsPublisher
Returns:
a List of Action objects (or null values)

setOwnerPR

public void setOwnerPR(ProcessingResource pr)
Registers the PR using the engine with the engine itself.

Specified by:
setOwnerPR in interface MLEngine
Parameters:
pr - the processing resource that owns this engine.