Hi,
Thanks for your fast reply!
“it seems that the final class prediction would be the same? You did not show the final prediction.”
→ Yes the final prediction still the same despite the different values.
“We make the assumption that you would predict all the samples from your test set in one go.”
→ I can’t predict a single sample from another study, is that it? Is there a reason?
I read the “Prediction distances” part of the supplemental material of mixOmics
(https://ndownloader.figshare.com/files/9754087) but I don’t understand why we can not predict a single sample from another study?
From your example, I was able to create a model from the studies 1, 2 and 3 and I try to predict 2 samples from manipulation 4. This gives me opposite prediction values (see below), why?
res.predict$predict
, , dim3
Fibroblast hESC hiPS
124 -0.07785964 -0.3872099 0.4342543
125 0.07785964 0.3872099 -0.4342543
(> The script allowing me to get this :
library(mixOmics)
data(stemcells)
index.study4=c(124,125)
2 samples of study 4 will be used as external test set
X4 <-stemcells$gene[index.study4,]
rownames(X4)=c(“124”,“125”)
external_study=c(4,4)
here we remove study 4 in the training set
index.study4 ← which(stemcells$study == 4)
X ← stemcells$gene[-index.study4,]
Y ← stemcells$celltype[-index.study4]
study ← droplevels(stemcells$study[-index.study4])
mint method
res ← mint.splsda(X = X, Y = Y, ncomp = 3, keepX = c(50,50,50),
study = study)
res.predict ← predict(res, X4, study.test = external_study)
res.predict$predict
res.predict$class
)
If I put the same sample twice, I get 0 :
Fibroblast hESC hiPS
125-1 0 0 0
125-2 0 0 0
I think this is due to the assumption that I must predict all the samples from my test set in one go. However if I have only one sample I can’t predict it. Is that right?
Jérémy