public class AtomicModel extends java.lang.Object implements InstanceModel
| Modifier and Type | Field and Description |
|---|---|
static java.lang.Class<?>[] |
argTypes |
| Constructor and Description |
|---|
AtomicModel(int index,
Model parent)
Constructs an atomic model.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addInstance(FeatureVector featureVector,
SingleDecision decision) |
void |
decreaseFrequency() |
FeatureVector |
extract(FeatureVector featureVector) |
void |
finalizeSentence(DependencyStructure dependencyGraph) |
int |
getFrequency()
Returns the frequency (number of instances)
|
ClassifierGuide |
getGuide()
Returns the feature vector used by this atomic model
|
int |
getIndex()
Returns the index of the atomic model
|
LearningMethod |
getMethod()
Returns a learner object
|
java.lang.String |
getModelName() |
Model |
getParent()
Returns the parent guide model
|
void |
increaseFrequency()
Increase the frequency by 1
|
void |
moveAllInstances(AtomicModel model,
FeatureFunction divideFeature,
java.util.ArrayList<java.lang.Integer> divideFeatureIndexVector)
Moves all instance from this atomic model into the destination atomic model and add the divide feature.
|
void |
noMoreInstances(FeatureModel featureModel) |
boolean |
predict(FeatureVector featureVector,
SingleDecision decision) |
FeatureVector |
predictExtract(FeatureVector featureVector,
SingleDecision decision) |
protected void |
setFrequency(int frequency)
Sets the frequency (number of instances)
|
void |
terminate() |
java.lang.String |
toString() |
void |
train()
Invokes the train() of the learning method
|
public static final java.lang.Class<?>[] argTypes
public AtomicModel(int index, Model parent) throws MaltChainedException
index - the index of the atomic model (-1..n), where -1 is special value (used by a single model
or the master divide model) and n is number of divide models.parent - the parent guide model.MaltChainedExceptionpublic void addInstance(FeatureVector featureVector, SingleDecision decision) throws MaltChainedException
addInstance in interface InstanceModelMaltChainedExceptionpublic void noMoreInstances(FeatureModel featureModel) throws MaltChainedException
noMoreInstances in interface ModelMaltChainedExceptionpublic void finalizeSentence(DependencyStructure dependencyGraph) throws MaltChainedException
finalizeSentence in interface ModelMaltChainedExceptionpublic boolean predict(FeatureVector featureVector, SingleDecision decision) throws MaltChainedException
predict in interface InstanceModelMaltChainedExceptionpublic FeatureVector predictExtract(FeatureVector featureVector, SingleDecision decision) throws MaltChainedException
predictExtract in interface InstanceModelMaltChainedExceptionpublic FeatureVector extract(FeatureVector featureVector) throws MaltChainedException
extract in interface InstanceModelMaltChainedExceptionpublic void terminate() throws MaltChainedException
terminate in interface ModelMaltChainedExceptionpublic void moveAllInstances(AtomicModel model, FeatureFunction divideFeature, java.util.ArrayList<java.lang.Integer> divideFeatureIndexVector) throws MaltChainedException
model - the destination atomic modeldivideFeature - the divide featuredivideFeatureIndexVector - the divide feature index vectorMaltChainedExceptionpublic void train() throws MaltChainedException
train in interface InstanceModelMaltChainedExceptionpublic Model getParent() throws MaltChainedException
MaltChainedExceptionpublic java.lang.String getModelName()
getModelName in interface Modelpublic ClassifierGuide getGuide()
public int getIndex()
public int getFrequency()
public void increaseFrequency()
increaseFrequency in interface InstanceModelpublic void decreaseFrequency()
decreaseFrequency in interface InstanceModelprotected void setFrequency(int frequency)
frequency - (number of instances)public LearningMethod getMethod()
public java.lang.String toString()
toString in class java.lang.ObjectCopyright 2007-2017 Johan Hall, Jens Nilsson and Joakim Nivre.