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.MaltChainedException
public void addInstance(FeatureVector featureVector, SingleDecision decision) throws MaltChainedException
addInstance
in interface InstanceModel
MaltChainedException
public void noMoreInstances(FeatureModel featureModel) throws MaltChainedException
noMoreInstances
in interface Model
MaltChainedException
public void finalizeSentence(DependencyStructure dependencyGraph) throws MaltChainedException
finalizeSentence
in interface Model
MaltChainedException
public boolean predict(FeatureVector featureVector, SingleDecision decision) throws MaltChainedException
predict
in interface InstanceModel
MaltChainedException
public FeatureVector predictExtract(FeatureVector featureVector, SingleDecision decision) throws MaltChainedException
predictExtract
in interface InstanceModel
MaltChainedException
public FeatureVector extract(FeatureVector featureVector) throws MaltChainedException
extract
in interface InstanceModel
MaltChainedException
public void terminate() throws MaltChainedException
terminate
in interface Model
MaltChainedException
public 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 vectorMaltChainedException
public void train() throws MaltChainedException
train
in interface InstanceModel
MaltChainedException
public Model getParent() throws MaltChainedException
MaltChainedException
public java.lang.String getModelName()
getModelName
in interface Model
public ClassifierGuide getGuide()
public int getIndex()
public int getFrequency()
public void increaseFrequency()
increaseFrequency
in interface InstanceModel
public void decreaseFrequency()
decreaseFrequency
in interface InstanceModel
protected void setFrequency(int frequency)
frequency
- (number of instances)public LearningMethod getMethod()
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 2007-2017 Johan Hall, Jens Nilsson and Joakim Nivre.