Learn R Programming

LPStimeSeries (version 1.0-5)

getTreeInfo: Extract a single tree from the ensemble.

Description

This function extracts the structure of a tree from a learnPattern object.

Usage

getTreeInfo(object, which.tree=1)

Arguments

object
a learnPattern object.
which.tree
which tree to extract?

Value

is a list with the following components:
segment.length
the proportion of the time series length used for both predictors and targets.
target
starting time of the target segment.
target.type
type of the target segment; 1 if observed series, 2 if difference series.
tree
Tree structure matrix with seven columns and number of rows equal to total number of nodes in the tree.
The seven columns of the tree structure matrix are:
left daughter
the row where the left daughter node is; 0 if the node is terminal
right daughter
the row where the right daughter node is; 0 if the node is terminal
split segment
start time of the segment used to split the node
split type
type of the predictor segment used to split the node; 1 if observed series, 2 if the different series are used. 0 if the node is terminal
split point
where the best split is
status
is the node terminal (-1) or not (-3)
depth
the depth of the node
prediction
the prediction for the node

See Also

learnPattern

Examples

Run this code
data(GunPoint)
set.seed(71)

## Learn patterns on GunPoint training series with 50 trees
ensemble=learnPattern(GunPoint$trainseries,ntree=50)
getTreeInfo(ensemble, 3)

Run the code above in your browser using DataLab