ramhiser / sparsediscrim

Sparse and Regularized Discriminant Analysis in R
Other
15 stars 5 forks source link

HDRDA classifier returns NA for the Nakayama data set in rare cases #20

Closed ramhiser closed 10 years ago

ramhiser commented 11 years ago

For some unknown reason, the hdrda classifier is returning an NA for the Nakayama data set with d = 500 for the HDRDA paper. Need to figure out why and resolve it.

ramhiser commented 11 years ago

Actually, I do not think this is a bug per se. I found the following error in my log file:

Error in regdiscrim_estimates(x = x, y = y, cov = FALSE, prior = prior) :
  There must be at least 2 observations in each class.
Error in eval(substitute(expr), data, enclos = parent.frame()) :
  invalid 'envir' argument of type 'logical'
Error in UseMethod("predict") :
  no applicable method for 'predict' applied to an object of class "logical"

Apparently, during the cross-validation used to estimate the optimal tuning parameters, one of the classes most likely has too few observations in it, in which case an error is thrown.

Should we update the cross-validation folds to guarantee that each class has at least two observations?