mixOmicsTeam / mixOmics

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

Non-conformable arguments in perf() #273

Open SrikRaja opened 1 year ago

SrikRaja commented 1 year ago

Please follow all the steps described at https://mixomics-users.discourse.group/t/reproducible-example-to-clarify-issues/470 and next fill in the items below:


X has 57 rows and 84 columns Y has 57 rows and 4 columns pls.result <- pls(X, Y, ncomp = 15, mode = "regression") #runs fine perf.results <- perf(pls.result, validation = 'Mfold', folds = 3, progressBar = TRUE, nrepeat = 5) #errors out

Error in X.test %*% a.cv : non-conformable arguments

Issue remains even with the latest version - 6.22

🔍 reprex results from reproducible example including sessioninfo():


🤔 Expected behavior:


💡 Possible solution:

Max-Bladen commented 1 year ago

I can see where this error is occuring (here). However, I cannot reproduce it. My guess is that your loading vector for the X dataframe is NULL for some reason. If you provide your email, I can reach out and we can resolve this. I may need access to your data to diagnose the issue

mfisher5 commented 9 months ago

I am encountering the same problem, using the code below:

 > cw.lgtax.pls4 <- pls(Y = cw.lg.mat, X = index.lg.mat,  ncomp=4, mode = 'regression') ## runs
 > set.seed(33)  
 > Q2.lgtax.pls4 <- perf(cw.lgtax.pls4, validation = 'Mfold', 
                      folds = 10, nrepeat = 5)

Error in X.test %*% a.cv : non-conformable arguments

I'm happy to share data over email to resolve it; I attached histograms to give an overview of the data values in each matrix. The "X" matrix contains a relative abundance index based on DNA metabarcoding (COI) data, consists of 153 rows (samples) and 112 columns (taxa), the "Y" matrix contains 153 rows (samples and 1 column (continuous biological variable).

test_spls_histX test_spls_cw