org.allenai.nlpstack.parse.poly.decisiontree

DecisionTree

case class DecisionTree(child: IndexedSeq[Seq[(Int, Int)]], splittingAttribute: IndexedSeq[Option[Int]], categoryCounts: IndexedSeq[Seq[(Int, Int)]]) extends Product with Serializable

Immutable decision tree for integer-valued features and categories.

Each data structure is an indexed sequence of properties. The ith element of each sequence is the property of node i of the decision tree.

child

stores the children of each node (as a map from attribute values to node ids)

splittingAttribute

stores the attribute that each node splits on; can be None for leaf nodes

categoryCounts

for each node, stores a map of categories to their frequency of appearance at that node (i.e. how many times a training vector with that category makes it to this node during classification)

Linear Supertypes
Serializable, Serializable, Product, Equals, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. DecisionTree
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new DecisionTree(child: IndexedSeq[Seq[(Int, Int)]], splittingAttribute: IndexedSeq[Option[Int]], categoryCounts: IndexedSeq[Seq[(Int, Int)]])

    child

    stores the children of each node (as a map from attribute values to node ids)

    splittingAttribute

    stores the attribute that each node splits on; can be None for leaf nodes

    categoryCounts

    for each node, stores a map of categories to their frequency of appearance at that node (i.e. how many times a training vector with that category makes it to this node during classification)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. lazy val allAttributes: Set[Int]

    All attributes used in the decision tree.

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def categoryCounts(inst: FeatureVector): Map[Int, Int]

  9. val categoryCounts: IndexedSeq[Seq[(Int, Int)]]

    for each node, stores a map of categories to their frequency of appearance at that node (i.

    for each node, stores a map of categories to their frequency of appearance at that node (i.e. how many times a training vector with that category makes it to this node during classification)

  10. val categoryCountsMap: IndexedSeq[Map[Int, Int]]

  11. val child: IndexedSeq[Seq[(Int, Int)]]

    stores the children of each node (as a map from attribute values to node ids)

  12. val childMap: IndexedSeq[Map[Int, Int]]

    Map versions of the argument parameters (only included because Spray/JSON was not working with maps for reasons unclear to me).

  13. def classify(inst: FeatureVector): Int

    Classifies an instance.

    Classifies an instance.

    inst

    instance to classify

    returns

    predicted label

  14. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  15. val distribution: IndexedSeq[Map[Int, Double]]

    The probability distribution over categories for each node of the decision tree.

    The probability distribution over categories for each node of the decision tree.

    If this tree was trained with DecisionTreeTrainer, then the distribution is Laplacian-smoothed assuming one count for each label in the training data.

  16. def distributionForInstance(inst: FeatureVector): Map[Int, Double]

    Gets probability distribution of label.

    Gets probability distribution of label.

    inst

    instance to find distribution of

    returns

    probability distribution of label according to training data

  17. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  18. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. final def findDecisionPoint(inst: FeatureVector, nodeId: Int = 0): Int

    Finds the "decision point" of the specified instance.

    Finds the "decision point" of the specified instance. This is the node for which no child covers the instance.

    inst

    instance to classify

    returns

    the node the instance is classified into

    Annotations
    @tailrec()
  20. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  21. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  22. val mostProbableCategory: IndexedSeq[Int]

    The most probable category at each node of the decision tree.

  23. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. final def notify(): Unit

    Definition Classes
    AnyRef
  25. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  26. def print(featureNames: Vector[String], categoryNames: Vector[String], nodeId: Int = 0, tabbing: String = ""): Unit

    Prints the decision tree to stdout.

  27. def selectChild(nodeId: Int, inst: FeatureVector): Option[Int]

    From a particular node, chooses the correct child according to the instance and its splitting attribute (if there is one).

    From a particular node, chooses the correct child according to the instance and its splitting attribute (if there is one).

    nodeId

    the id of the node

    inst

    the instance

    returns

    the node id of the correct child (if there is one)

  28. val splittingAttribute: IndexedSeq[Option[Int]]

    stores the attribute that each node splits on; can be None for leaf nodes

  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  30. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  31. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  32. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped