gate.creole.ml
Interface MLEngine

All Known Implementing Classes:
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.
 Object classifyInstance(List attributes)
          Classifies a new instance.
 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

public 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

public 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.
ExecutionException

setDatasetDefinition

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

Parameters:
definition -

classifyInstance

public 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.
ExecutionException

init

public 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

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

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