ramhiser / sparsediscrim

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

Missing Values Cause Silent Failure of Prediction #43

Open DarioS opened 6 years ago

DarioS commented 6 years ago

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.