You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should either prohibit the condition or handle it more efficiently. stratified.subsampling is also unnecessarily lengthy.
data(liver.toxicity)
X<-liver.toxicity$geneY<-liver.toxicity$treatment$Dose.Group# create a class with one sample onlyY[1] <-'FOO'liver.plsda<- plsda(X, Y, ncomp=2)
liver.val<- perf(liver.plsda, validation="Mfold", folds=3)
#> Warning in MCVfold.spls(X, Y, multilevel = multilevel, validation = validation, : At least one class is not represented in one fold, which may unbalance the error rate.#> Consider a number of folds lower than the minimum in table(Y): 1#> Error in dimnames(x) <- dn: length of 'dimnames' [2] not equal to array extent
data(nutrimouse)
Y=nutrimouse$diet# create a class with one sample onlyY= as.character(Y)
Y[1] <-'FOO'data=list(gene=nutrimouse$gene, lipid=nutrimouse$lipid)
nutrimouse.sgccda<- block.splsda(X=data,
Y=Y,
keepX=list(gene=c(10,10), lipid=c(15,15)),
ncomp=2,
scheme="horst")
perf= perf(nutrimouse.sgccda)
#> Warning in repeat_cv_perf.diablo(nrep): At least one class is not represented in one fold, which may unbalance the error rate.#> Consider a number of folds lower than the minimum in table(Y): 1#> Error in (function (..., deparse.level = 1) : number of columns of matrices must match (see arg 2)perf#> function(object, ...)#> UseMethod("perf")#> <environment: namespace:mixOmics>
Implemented a check within the `perf.mixo_splsda()` function which prevents the method running if any of the classes have a single sample associated with them.
Also added to checks (in new file: `test-perf.mixo_splsda.R`) which ensure basic functionality as well as whether the function prevents a class with one sample being used.
fix: added specific check to `perf()` to notify user when there is a single sample associated with one of the classes in a DA context
test: included a basic test for function and to test functionality of new singple sample check
We should either prohibit the condition or handle it more efficiently.
stratified.subsampling
is also unnecessarily lengthy.Created on 2021-02-16 by the reprex package (v1.0.0)
The text was updated successfully, but these errors were encountered: