crossval.regmodel | R Documentation |
Does cross-validation of a regression model
crossval.regmodel(obj, x, y, cv, cal.fun, pred.fun, cv.scope = "local")
obj |
a regression model (object of class |
x |
a matrix with x values (predictors from calibration set) |
y |
a matrix with y values (responses from calibration set) |
cv |
number of segments (if cv = 1, full cross-validation will be used) |
cal.fun |
reference to function for model calibration |
pred.fun |
reference to function for getting predicted y-values (see description) |
cv.scope |
scope for center/scale operations inside CV loop: 'global' — using globally computed mean and std or 'local' — recompute new for each local calibration set. |
object of class plsres
with results of cross-validation
Function 'pred.fun' must take four agruments: autoscaled x-values, array with regression coefficients, vectors for centring and scaling of y-values (if used). The function must return predicted y-values in original units (unscaled and uncentered).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.