Packages

trait DecisionTree extends Error

The DecisionTree trait provides common capabilities for all types of decision trees.

Linear Supertypes
Error, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DecisionTree
  2. Error
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. def add(n: Node, vc: (Int, Node)*): Unit

    Add multiple child nodes to the tree via branchs from node 'n'.

    Add multiple child nodes to the tree via branchs from node 'n'.

    n

    the parent node

    vc

    the branch value and child node, repeatable

  2. def add(n: Node, v: Int, c: Node): Unit

    Add child node 'c' to the tree via branch 'v' from node 'n'.

    Add child node 'c' to the tree via branch 'v' from node 'n'.

    n

    the parent node

    v

    the branch value from the parent node

    c

    the child node

  3. def addRoot(r: Node): Unit

    Add the root node to the tree.

    Add the root node to the tree.

    r

    the root node of the tree

  4. def calcEntropy(nodes: ArrayBuffer[Node] = leaves): Double

    Calculate the entropy of the tree as the weighted average over the list of nodes (defualts to leaves).

    Calculate the entropy of the tree as the weighted average over the list of nodes (defualts to leaves).

    nodes

    the nodes to compute the weighted entropy over

  5. def classify2(z: VectoD): Int

    Given a data vector z, classify it returning the class number (0, ..., k-1) by following a decision path from the root to a leaf.

    Given a data vector z, classify it returning the class number (0, ..., k-1) by following a decision path from the root to a leaf. If no branch found, give maximal decision of current node. Return the best class and its name.

    z

    the data vector to classify

  6. def classify2(z: VectoI): Int

    Given a data vector z, classify it returning the class number (0, ..., k-1) by following a decision path from the root to a leaf.

    Given a data vector z, classify it returning the class number (0, ..., k-1) by following a decision path from the root to a leaf. If no branch found, give maximal decision of current node. Return the best class and its name.

    z

    the data vector to classify

  7. final def flaw(method: String, message: String): Unit
    Definition Classes
    Error
  8. def makeLeaf(n: Node): Unit

    As part of tree pruning, turn an internal node into a leaf.

    As part of tree pruning, turn an internal node into a leaf.

    n

    the node to turn into a leaf (pruning all nodes below it)

  9. def printTree(): Unit

    Print the decision tree using 'prinT' method from Node class.

  10. def reset(): Unit

    Reset or re-initialize counters, if needed.