Hello,
I am new to mixOmics here and currently doing my master thesis. I have met questions in sPLS-DA models and would be so kind of you if you could help or give some advice.
Size of my data is 42*47, because the sample size is small I use LOOCV for both model tuning and model validation. And the aim of the project includes feature selection, so I tried the sparse version. I followed the procedure from the examples for model tuning and feature selection and write the following for validation purpose:
pred <- vector()
for (i in 1:42){
pred[i] <- predict(splsda(x[-i,],y[-i], ncomp = ncomp, keepX = select.keepX), t(x[i,]) ,dist = “max.dist”)$class$max.dist[,4]
}
so that I can get the prediction accuracy and confusion matrix based on the 4th component.
However, this is using only one component but it is suggested that the number of components needed is 8. My question is: is there a way to combine all the information from all components and get the prediction result instead of using only one component?
Thank you very much for helping.
hi @Lydia0jj
The perf
function with argument validation = ‘loo’ should avoid you to run this code ‘manually’ and extract all the numerical outputs that you need, up to whichever component you specify in your trained model (see example in sPLSDA SRBCT Case Study() | mixOmics at the bottom).
My question is: is there a way to combine all the information from all components and get the prediction result instead of using only one component?
The outputs from perf() should aggregate the results up to the component specified.
Kim-Anh
Thank you very much for your reply and recall the usage of perf() function.
perf() gives prediction results based on the specified component, is there a way of using all components to give the predicted class (without determining the certain component) and calculate the auc?
hi @Lydia0jj,
What I was trying to say is, that by definition of a PLS model (sPLS-DA included), when you specify a component, it includes all the previous components from the model. So if you require ncomp = 3, it includes all that has been learnt for component 1 and 2. That is the way to use all components up to the specified component, basically. There is also an AUC argument in the perf()
function.
Kim-Anh