if (FALSE) # cut down on R CMD check time
nrml <- mspProcessData(faults = "NOC")
n <- nrow(nrml)
# Calculate the training summary, but save five observations for monitoring.
trainResults_ls <- mspTrain(data = nrml[1:(n - 5), -1],
labelVector = nrml[1:(n - 5), 1],
trainObs = 4320)
# While training, we included 1 lag (the default), so we will also lag the
# observations we will test.
testObs <- nrml[(n - 6):n, -1]
testObs <- xts:::lag.xts(testObs, 0:1)
testObs <- testObs[-1,]
testObs <- cbind(nrml[(n - 5):n, 1], testObs)
mspMonitor(observations = testObs[, -1],
labelVector = testObs[, 1],
trainingSummary = trainResults_ls$TrainingSpecs)
Run the code above in your browser using DataLab