MINT / background predict


I would like to use the function ‘background.predict’ to calculate prediction areas after a MINT splsda analysis.
Is it possible?
I’ve tried with both MINT plsda and MINT splsda but obtained the following error messages:


Error in background.predict(object = mint.plsda.res) :
‘background.predict’ can only be calculated for ‘plsda’
and ‘splsda’ objects

background=background.predict(object=mint.splsda.res, comp.predicted = 2, dist='max.dist')

Error in matrix(attr(Y, “scaled:center”), nrow = nrow(t.pred[[1]]), ncol = q, :
‘data’ must be of a vector type, was ‘NULL’

Can you help me with that?

Thanks a lot in advance,

Hi Olivier,

Thank you for letting us know about the feature you wish mixOmics to have. We implemented it in the development version and you and others can try it out now. You can install and test the it using the following code:

devtools::install_github("mixOmicsTeam/mixOmics", ref="devel", dependencies = FALSE, upgrade = "never")

An example of what must work before you move on to your own dataset is:

res = mint.splsda(X = stemcells$gene, Y = stemcells$celltype, ncomp = 3,
study = stemcells$study)
## before background

background = background.predict(res, comp.predicted = 2, dist = "mahalanobis.dist")
## after background
plotIndiv(res, background = background, legend = TRUE )

Please let us know how you go!