Learn R Programming

shatteringdt (version 0.1.0)

recurse: Calculates the shattering coefficient for a decision tree.

Description

Using a recursion, calculates the shattering coefficient for a rpart decision tree.

Usage

recurse(nodes, left, right, node, parent, samples, node_type, shattering, n_samples)

Arguments

nodes

list. A list containing the tree nodes.

left

int. The left child of the parent node.

right

int. The right child of the parent node.

node

int. The current node being analyzed

parent

int. The parent node of node.

samples

list. The number of dataset samples for each node of the tree.

node_type

string. The type of the node, e.g., leaf if it's a leaf node.

shattering

float. The shattering coefficient that are begin computed.

n_samples

int. The # of samples to consider in dataset.

Value

The calculus of the shattering coefficient.