Description Usage Arguments Value Author(s) References See Also Examples
Representation generation for test data using learnPattern.
1 2 3 |
object |
an object of class |
newdata |
a data frame or matrix containing new data. |
which.tree |
|
nodes |
|
maxdepth |
The maximum depth level to generate the representation |
... |
not used currently. |
Returns the learned pattern representation for the time series in the dataset
if nodes
is set TRUE
. Basically, it is the count of observed patterns at
each terminal node. Otherwise predicted values for each time series in newdata
are returned.
Mustafa Gokce Baydogan
Baydogan, M. G. (2013), “Learned Pattern Similarity“, Homepage: http://www.mustafabaydogan.com/learned-pattern-similarity-lps.html.
Breiman, L. (2001), Random Forests, Machine Learning 45(1), 5-32.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | data(GunPoint)
set.seed(71)
## Learn patterns on GunPoint training series with default parameters
ensemble=learnPattern(GunPoint$trainseries)
## Find representations
trainRep=predict(ensemble, GunPoint$trainseries, nodes=TRUE)
testRep=predict(ensemble, GunPoint$testseries, nodes=TRUE)
## Check size of the representation for training data
print(dim(trainRep))
## Learn patterns on GunPoint training series (target cannot be difference series)
ensemble=learnPattern(GunPoint$trainseries,target.diff=FALSE)
## Predict observations for test time series
predicted=predict(ensemble,GunPoint$testseries,nodes=FALSE)
## Plot an example test time series
plot(GunPoint$testseries[5,],type='l',lty=1,xlab='Time',ylab='Observation',lwd=2)
points(c(1:ncol(GunPoint$testseries)),predicted$predictions[5,],type='l',col=2,lty=2,lwd=2)
legend('topleft',c('Original series','Approximation'),col=c(1,2),lty=c(1,2),lwd=2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.