Error in perf function returned when running "loo"

Create issue
Issue #96 resolved
Former user created an issue

Hello, I am applying the perf fonction on a PLS or SPLS model I compute to predict Y from X. I use the following code:

model.pls.val <- perf(model.pls, validation = "loo")

and get the following error
"Error in predict.spls(spls.res, X.test[, nzv]) : 'newdata' must include all the variables of 'object$X' "

I am using the last version of the mixOmics package (installed from mixOmics_6.1.3b(1).tar.gz). About my data: there is no missing value, nor 0 value in the dataset. X data represents normalized values for 208 observations x 1000 variables (11 groups). Y is a gene expression list for 11 observations (1 for each group, so we copy paste to get 208 obs 11 groups to fit X). there are 2600 variables in Y. We center scale the Y variable, and scale the X variable from 0 to 1.

Besides, I noticed an error in the description given in example for leave-one-and-out cross validation using spls (in the perf.spls help):

validation for objects of class 'spls' (regression)

with leave-one-out cross validation

model.spls.val <- perf(model.spls, validation = "Mfold", folds = 5 )#validation = "loo")

Thank you very much for the nice work! Best regards, Arno Germond

Comments (2)

  1. Log in to comment