getRMSE: get RMSE from mvr object

Description Usage Arguments Examples

Description

Alternative to pls package's 'RMSEP'. While 'RMSEP' requires a 'newdata' dataframe which combines both predictors and target, 'getRMSE' lets you put in 'newx' and 'newy' separately. Aside from that, declaring 'estimate' in 'getRMSE' remind you which value you got.

Usage

1
2
getRMSE(mvr, ncomp = mvr$ncomp, estimate, newx = NULL, newy = NULL,
  showprint = TRUE)

Arguments

mvr

mvr object

ncomp

number of component

estimate

a subset of c("train", "CV", "test")

newx

predictors for test group

newy

measured value for test group

showprint

show result in console

Examples

1
2
3
4
5
6
require(pls)
data(yarn)
model <- plsr(density ~ NIR, 6, data = yarn, validation = "CV")
RMSEP(model)
getRMSE(model, estimate = "train") # return RMSE at particular ncomp without intercept value
getRMSE(model, estimate = "CV")

chengvt/cheng documentation built on May 13, 2019, 3:52 p.m.