visualizePattern: Plot of the patterns learned by the ensemble of the...

Description Usage Arguments Value Note Author(s) See Also Examples

Description

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

Usage

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

Note

Patterns are visualized for the time series for which the frequency of the observations in the pattern is the largest. If more than one plot is requested through the setting of orient, the patterns are plotted for the time series based on the descending order of the frequency.

Currently, patterns are visualized based on the first predictor segment (sampled at the root node). This visualization can be done based on the predictor segment sampled at each level of the tree.

predictor and target are of size x where the patterns are numerical values and the rest of the entries are NAs.

Author(s)

Mustafa Gokce Baydogan

See Also

learnPattern,predict.learnPattern

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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))

LPStimeSeries documentation built on May 2, 2019, 8:25 a.m.