Q2.total has changed in last versions of MixOmis?

Hiya!
I am using the perf function to select number of components in a PLS model. I select the num of components based on Q2.total after 50 repetitions.
Few months ago (not sure in which MixOmics version) I was using this code to get the best number of components:
object<-pls(X,Y,ncomp=10, mode=“regression”)
tune.pls<-perf(object2,validation = “Mfold”, folds = 10, progressBar = FALSE, nrepeat =nrep) #CV
ncomp=which(tune.pls$Q2.total=max(tune.pls$Q2.total))

Now, after updating the mixOmics to version (6.19.1); tune.pls$Q2.total is not implemmented anymore, now (I think) has been replaced by tune.pls$measures$Q2.total$summary:
temp=tune.pls$measures$Q2.total$summary
ncomp=temp[which.max(tune.pls$measures$Q2.total$summary$mean),2]

My issue comes when now, I get different Q2.total numbers than in the previous version, and different comp selected. I was wondering, whether I am doing something wrong, or the Q2total estimation has been modified?

Many thanks for your time!
BW
Marina

object<-pls(X,Y,ncomp=10, mode=“regression”)
tune.pls<-perf(object2,validation = “Mfold”, folds = 10, progressBar = FALSE, nrepeat =nrep) #CV

Just checking, in the first line you define object, but in the perf() function, you use object2. Are these different variables? This may be the root of your issue, but I’ll assume otherwise.

I have only recently started work on this package. However, looking at the GitHub, the last time this function was updated at all was April 2021. This means no change has occurred to this function in 11 months. Prior to this, I cannot specifically find when the $measures component was added. I would be very surprised if you were able to access these values without the $measures component only a few months ago. Have a look for yourself here.

I’ll ask around to see if there were any adjustments made, but it seems that this may be an issue on your end. If you can give me a more exact time frame to which you used this call, I can aid more.

Cheers,
Max.

1 Like

Dear Max,

Many thanks for your response!
Sorry for this, it was a typo of mine when writing the message, and “object” is always “object2”.
Also, I think my issue is solved now, I think it was a problem with the scaling.
Many thanks for the support!
BW,
Marina

Fantastic to hear it’s resolved. Just in case there is an issue with the package, when you say a problem with the scaling, what do you mean? Do you mean that you get different Q2.total values depending on whether you scale the data first or not?

Cheers,
Max.