DecisionTree

scalation.modeling.classifying.DecisionTree
See theDecisionTree companion object
trait DecisionTree

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

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes

Members list

Value members

Concrete methods

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.

Value parameters

c

the child node

n

the parent node

v

the branch value from the parent node

Attributes

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'.

Value parameters

n

the parent node

vc

the branch value and child node, repeatable

Attributes

def addRoot(r: Node): Unit

Add the root node to the tree.

Add the root node to the tree.

Value parameters

r

the root node of the tree

Attributes

def bestCandidate(can: Set[Node]): (Node, Double)

Of all the pruning candidates, find the one with the least gain.

Of all the pruning candidates, find the one with the least gain.

Value parameters

can

the nodes that are canidates for pruning

Attributes

def calcEntropy(nodes: ArrayBuffer[Node]): Double

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

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

Value parameters

nodes

the nodes to compute the weighted entropy over

Attributes

def candidates: Set[Node]

Find candidate nodes that may be pruned, i.e., those that are parents of leaf nodes, restricted to those that don't have any children that are themselves internal nodes.

Find candidate nodes that may be pruned, i.e., those that are parents of leaf nodes, restricted to those that don't have any children that are themselves internal nodes.

Attributes

def leafChildren(n: Node): Boolean

Determine whether all the children of node n are leaf nodes.

Determine whether all the children of node n are leaf nodes.

Value parameters

n

the node in question

Attributes

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.

Value parameters

n

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

Attributes

def predictIrec(z: VectorI, n: Node): Int

Auxilliary predict method facilitating recursion for VectorI.

Auxilliary predict method facilitating recursion for VectorI.

Value parameters

n

the current node in the tree

z

the data vector to classify

Attributes

def predictIrecD(z: VectorD, n: Node): Int

Auxilliary classify method facilitating recursion for VectorD.

Auxilliary classify method facilitating recursion for VectorD.

Value parameters

n

the current node in the tree

z

the data vector to classify

Attributes

def printTree(): Unit

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

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

Attributes