GATE
Version 3.1-2270

gate.creole.ml
Interface MLEngine

All Known Subinterfaces:
AdvancedMLEngine
All Known Implementing Classes:
MaxentWrapper, SVMLightWrapper, Wrapper

public interface MLEngine

This interface is used for wrappers to Machine Learning engines. All classes implementing this interface should have a public constructor that takes no parameters.


Method Summary
 void addTrainingInstance(List attributes)
          Adds a new training instance to the dataset.
 List batchClassifyInstances(List instances)
          Like classify instances, but take a list of instances instead of a single instance, and return a list of results (one for each instance) instead of a single result.
 Object classifyInstance(List attributes)
          Classifies a new instance.
 void cleanUp()
          Cleans up any resources allocated by the Engine when it is destroyed.
 void init()
          This method will be called after an engine is created and has its dataset and options set.
 void setDatasetDefinition(DatasetDefintion definition)
          Sets the definition for the dataset used.
 void setOptions(org.jdom.Element options)
          Sets the options from an XML JDom element.
 void setOwnerPR(ProcessingResource pr)
          Registers the PR using the engine with the engine itself.
 

Method Detail

setOptions

void setOptions(org.jdom.Element options)
Sets the options from an XML JDom element.

Parameters:
options - the JDom element containing the options from the configuration.

addTrainingInstance

void addTrainingInstance(List attributes)
                         throws ExecutionException
Adds a new training instance to the dataset.

Parameters:
attributes - 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.
Throws:
ExecutionException

setDatasetDefinition

void setDatasetDefinition(DatasetDefintion definition)
Sets the definition for the dataset used.

Parameters:
definition -

classifyInstance

Object classifyInstance(List attributes)
                        throws ExecutionException
Classifies a new instance.

Parameters:
attributes - 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.
Throws:
ExecutionException

batchClassifyInstances

List batchClassifyInstances(List instances)
                            throws ExecutionException
Like classify instances, but take a list of instances instead of a single instance, and return a list of results (one for each instance) instead of a single result.

Parameters:
instances - A list of lists of attributes describing the instance. The value for all of the class elements will be arbitrary.
Returns:
A list of values predicted for the class attribute, which will be Strings when the class in nominal or boolean, and a Double values otherwise.
Throws:
ExecutionException

init

void init()
          throws GateException
This method will be called after an engine is created and has its dataset and options set. This allows the ML engine to initialise itself in preparation of being used.

Throws:
GateException

setOwnerPR

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

Parameters:
pr - the processing resource that owns this engine.

cleanUp

void cleanUp()
Cleans up any resources allocated by the Engine when it is destroyed. (Generally this is most likely to be needed by those wrappers that call native code.)


GATE
Version 3.1-2270