sparsediscrim
sparsediscrim copied to clipboard
Missing Values Cause Silent Failure of Prediction
Although the discriminant methods require complete data, the software allows matrices with missing data to be input and doesn't print any warning or error messages.
> iris[10, 2] <- NA
> trained <- dlda(x = iris[, -5], y = iris[, 5])
> predict(trained, iris[, -5])[["class"]]
factor(0)
Levels: setosa versicolor virginica
May better input checking be added and also mention of the handling of missing data in the function documentation? It's also unexpected that a data.frame works in the example, although the documentation states x: matrix containing the training data.