DecisionTreeModel (MaltParser 1.4.1)
Date: 2010-07-15

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| MaltParser 1.4.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.maltparser.parser.guide.instance
Class DecisionTreeModel

    java.lang.Object
      org.maltparser.parser.guide.instance.DecisionTreeModel

All Implemented Interfaces:
  InstanceModel, Model

    public class DecisionTreeModel

extends Object
implements InstanceModel

This class implements a decision tree model. The class is recursive and an instance of the class can be a root model or belong to an other decision tree model. Every node in the decision tree is represented by an instance of the class. Node can be in one of the three states branch model, leaf model or not decided. A branch model has several sub decision tree models and a leaf model owns an atomic model that is used to classify instances. When a decision tree model is in the not decided state it has both sub decision trees and an atomic model. It can be in the not decided state during training before it is tested by cross validation if the sub decision tree models provide better accuracy than the atomic model.

Author:
  Kjell Winblad

Constructor Summary
`DecisionTreeModel(FeatureVector featureVector, Model parent)` Constructs a feature divide model.

Method Summary
`void` | `addInstance(SingleDecision decision)`
`void` | `decreaseFrequency()`
`FeatureVector` | `extract()`
`void` | `finalizeSentence(DependencyStructure dependencyGraph)`
`int` | `getFrequency()`
`ClassifierGuide` | `getGuide()`
`int` | `getModelIndex()`
`String` | `getModelName()`
`Model` | `getParent()`
`void` | `increaseFrequency()` Increase the frequency by 1
`protected void` | `load()` Loads the feature divide model settings .fsm file.
`void` | `noMoreInstances()`
`boolean` | `predict(SingleDecision decision)`
`FeatureVector` | `predictExtract(SingleDecision decision)`
`void` | `setFrequency(int frequency)`
`void` | `setParent(Model parent)`
`void` | `terminate()`
`void` | `train()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DecisionTreeModel

    public DecisionTreeModel(FeatureVector featureVector,
                             Model parent)
                      throws MaltChainedException

  Constructs a feature divide model.

  Parameters:
    `featureVector` - the feature vector used by the decision tree model
    `parent` - the parent guide model.
  Throws:
    `MaltChainedException`

Method Detail

### load

    protected void load()
                 throws MaltChainedException

  Loads the feature divide model settings .fsm file.

  Throws:
    `MaltChainedException`

### addInstance

    public void addInstance(SingleDecision decision)
                     throws MaltChainedException

  Specified by:
    `addInstance` in interface `InstanceModel`
  Throws:
    `MaltChainedException`

### extract

    public FeatureVector extract()
                          throws MaltChainedException

  Specified by:
    `extract` in interface `InstanceModel`
  Throws:
    `MaltChainedException`

### increaseFrequency

    public void increaseFrequency()

  Increase the frequency by 1

  Specified by:
    `increaseFrequency` in interface `InstanceModel`

### decreaseFrequency

    public void decreaseFrequency()

  Specified by:
    `decreaseFrequency` in interface `InstanceModel`

### predict

    public boolean predict(SingleDecision decision)
                    throws MaltChainedException

  Specified by:
    `predict` in interface `InstanceModel`
  Throws:
    `MaltChainedException`

### predictExtract

    public FeatureVector predictExtract(SingleDecision decision)
                                 throws MaltChainedException

  Specified by:
    `predictExtract` in interface `InstanceModel`
  Throws:
    `MaltChainedException`

### train

    public void train()
               throws MaltChainedException

  Specified by:
    `train` in interface `InstanceModel`
  Throws:
    `MaltChainedException`

### finalizeSentence

    public void finalizeSentence(DependencyStructure dependencyGraph)
                          throws MaltChainedException

  Specified by:
    `finalizeSentence` in interface `Model`
  Throws:
    `MaltChainedException`

### getGuide

    public ClassifierGuide getGuide()

  Specified by:
    `getGuide` in interface `Model`

### getModelName

    public String getModelName()
                        throws MaltChainedException

  Specified by:
    `getModelName` in interface `Model`
  Throws:
    `MaltChainedException`

### noMoreInstances

    public void noMoreInstances()
                         throws MaltChainedException

  Specified by:
    `noMoreInstances` in interface `Model`
  Throws:
    `MaltChainedException`

### terminate

    public void terminate()
                   throws MaltChainedException

  Specified by:
    `terminate` in interface `Model`
  Throws:
    `MaltChainedException`

### setParent

    public void setParent(Model parent)

### getParent

    public Model getParent()

### setFrequency

    public void setFrequency(int frequency)

### getFrequency

    public int getFrequency()

### getModelIndex

    public int getModelIndex()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| MaltParser 1.4.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright 2007-2010 Johan Hall, Jens Nilsson and Joakim Nivre.