mixOmicsTeam / mixOmics

Development repository for the Bioconductor package 'mixOmics '
http://mixomics.org/
150 stars 51 forks source link

non-conformable matrices in perf.pls() #286

Closed Max-Bladen closed 1 year ago

Max-Bladen commented 1 year ago

🐞 Describe the bug:

Found in Chapter 04 (PLS) of new bookdown. I believed this issue was resolved, but apparently not


🔍 reprex results from reproducible example including sessioninfo():

library(mixOmics)
data(liver.toxicity)
X <- liver.toxicity$gene
Y <- liver.toxicity$clinic
y <- liver.toxicity$clinic[, "ALB.g.dL."]

tune.pls1.liver <- pls(X = X, Y = y, ncomp = 4, mode = 'regression')
set.seed(1)  # For reproducibility with this handbook, remove otherwise
Q2.pls1.liver <- perf(tune.pls1.liver, validation = 'Mfold', 
                      folds = 10, nrepeat = 5)
plot(Q2.pls1.liver, criterion = 'Q2')
# Error in Y.test[, nzv.Y] %*% b.cv : non-conformable arguments

🤔 Expected behavior:

No error should be raised


💡 Possible solution:

Running different seeds did not resolve issue.