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
X1<-data.frame(matrix(rnorm(100000, 5, 5), nrow=100))
X2<-data.frame(matrix(rnorm(150000, 5, 5), nrow=100))
Y<- c(rep("A", 50), rep("B", 50))
X<-list(block1=X1, block2=X2)
list.keepX<-list(block1=c(15, 15), block2=c(30,30))
## NO ERROR RAISEDX$block1[,1] <- rep(0, 100)
model= block.splsda(X=X, Y=Y, ncomp=2,
keepX=list.keepX, design="full")
#> Warning in cor(A[[k]], variates.A[[k]]): the standard deviation is zeroauc.splsda= auroc(model)
#> $block1#> $block1$comp1#> AUC p-value#> A vs B 0.8364 6.723e-09#> #> $block1$comp2#> AUC p-value#> A vs B 0.9104 1.515e-12#> #> #> $block2#> $block2$comp1#> AUC p-value#> A vs B 0.9404 3.197e-14#> #> $block2$comp2#> AUC p-value#> A vs B 0.9812 0## ERROR RAISEDX$block1[,1] <- rep(1, 100)
model= block.splsda(X=X, Y=Y, ncomp=2,
keepX=list.keepX, design="full")
#> Warning in cor(A[[k]], variates.A[[k]]): the standard deviation is zeroauc.splsda= auroc(model)
#> Error in cut.default(cases, thresholds): invalid number of intervals
fix: added fail safe for when `Inf` or `-Inf` are found in transformed `newdata` data frame.
Changes them to `NaN` which can be safely handled by downstream functions
* Fix for Issue #266
fix: added fail safe for when `Inf` or `-Inf` are found in transformed `newdata` data frame.
Changes them to `NaN` which can be safely handled by downstream functions
* Fix for Issue #266
tests: added test to maintain coverage
🐞 Describe the bug:
When applying
auroc()
toblock.splsda
objects, if any of the predictors variance equal to 0 and a center not equal to 0, following error is raised:Error in cut.default(cases, thresholds) : invalid number of intervals
.If the zero-variance feature(s)'s center is 0, NO error is raised. If it not 0, then error raised.
🔍 reprex results from reproducible example including sessioninfo():
Created on 2022-11-15 with reprex v2.0.2
Note: when first feature of first block are all 0s,
auroc()
functions as normal. If feature is all 1s,auroc()
fails.🤔 Expected behavior:
Features with zero variance should not be allowed - this will be addressed in its own branch and pull request.
A fail safe should be implemented as temporary fix
💡 Possible solution:
Requires exploration
The text was updated successfully, but these errors were encountered: