mixOmicsTeam/mixOmics

issue in tune.spca

marinamartinezalvaro opened this issue · 4 comments

Hi!

I am finding a problem when selecting the optimum number of variables to select in sPCA using tune.spca function (I am just following the tutorial of your new book)

My database Looks as:
MI.Chamber..kg.d. CH4..g.d. CH4..g.kgDMI. CH4.CO2.molar.ratio acppn
1 10.62 224.0852 21.10030 0.05591692 664.7998
2 12.78 281.3863 22.01771 0.06767347 659.2013
3 14.06 320.3933 22.78758 0.07525992 617.3418
4 10.77 152.8363 14.19093 0.04136067 620.0376
5 6.64 NA NA NA 628.9639

I do not find any problem when running tune.pca to determine the number of components. But i am getting an issue with tune.spca to determine the optimum number of variables to select:

grid.keepX<-c(seq(5,30,5))
tune.spca.result<-tune.spca(X, ncomp=3, folds=4, test.keepX=grid.keepX, nrepeat=10)
Error: Unexpected error while trying to choose the optimum number of components. Please check the inputs and if problem persists submit an issue to https://github.com/mixOmicsTeam/mixOmics/issues

It works until nrepeat=2 but fails when nrepeat is bigger.
Any assistance would be very helpful
Many thanks!
Marina


🤔 Expected behavior:


💡 Possible solution:

Hi @marinamartinezalvaro,

Thanks for submitting this issue.

Did you have only 5 variables in the dataset? I can see that you're trying to tune up to 30 variables.

If all checks, can you please send us a confidential email with the dataset and code that leads to this behaviour?
You can click on this text to send us an email.
Alternatively, you can right-click on the above text and choose ‘Copy Email Address’

Cheers

Al

Dear Al,

Thanks for your response. I have 48 variables with 72 records for each variable (with some missing values.
I am sending an email now!
Many thanks!
BW
Marina

Dear Al,
please could you confirm you recieved my email?
Many thanks
Marina

Solution implemented via PR #276