Learn R Programming

LPStimeSeries (version 1.0-5)

visualizePattern: Plot of the patterns learned by the ensemble of the regression trees

Description

visualizePattern visualizes the patterns implied by the terminal nodes of the trees from learnPattern object.

Usage

visualizePattern(object, x, which.terminal, orient=c(2,2))

Arguments

object
an object of class learnPattern, as that created by the function learnPattern.
x
a data frame or matrix containing the data for pattern visualization.
which.terminal
id of the terminal node determining the decision rules to be used for identifying patterns
orient
orientation of the plot (determines the grid structure and how many patterns to be visualized).

Value

A list with the following components are returned invisibly.
predictor
predictor segments residing in the which.terminal.
target
target segments implied by the which.terminal.
tree
the tree id corresponding to the which.terminal.
terminal
the id of the terminal node for the tree.

See Also

learnPattern,predict.learnPattern

Examples

Run this code
set.seed(71)
data(GunPoint)
## Learn patterns on GunPoint training series with default parameters
ensemble=learnPattern(GunPoint$trainseries)

## Find representations
trainRep=predict(ensemble, GunPoint$trainseries, nodes=TRUE)

## Find the average frequency over the terminal nodes
avgFreq=apply(trainRep,2,mean)

## Find the terminal node that has the maximum average and visualize
termid=which.max(avgFreq)
visualizePattern(ensemble,GunPoint$trainseries,termid,c(2,1))

Run the code above in your browser using DataLab