Closed topepo closed 8 years ago
Thanks for letting me know, @topepo. Missed your issue somehow. I'll take a look right now.
In the latest version (0.2.2) on master, the error with predicting a single sample is no longer present. A couple of issues still remain:
I'm looking into both issues.
Side note: the latest version of sparsediscrim
on CRAN is 0.2. I'll update it on CRAN after the fix.
> library(caret)
> set.seed(1)
> dat <- twoClassSim(101)
> trn <- dat[1:100,]
> tst <- dat[101,]
> mod <- hdrda(x = as.matrix(trn[, -ncol(trn)]), y = trn$Class)
> predict(mod, newdata=trn[1, -ncol(tst)])
$class
[1] Class1
Levels: Class1 Class2
$scores
Class1.1 Class2.1
9.539882 13.343029
$posterior
Class1.1 Class2.1
1.00000000 0.02230046
Thanks for reporting the issue, @topepo. Resolved.
I'll push to CRAN soon.
Thanks for the fix.
Max
Using version 0.2 I have issues when predicting a new data set with a single row:
with
This examples throws an error "
Error in which.min(scores) : (list) object cannot be coerced to type 'double'
".In other cases (data not available) it gives posteriors that don't add to one or results with >1 dimension:
and:
Thanks,
Max