1
votes

I ran the train() with method = "lda" value = "finalModel" without errors to completion, changed to method = "qda" and I get errors... I am working on Generative Models.

library(dslabs) 
library(caret)
data("tissue_gene_expression")
set.seed(1993) 
y <- tissue_gene_expression$y
x <- tissue_gene_expression$x
x <- x[, sample(ncol(x), 10)]

fit_qda <- train(x, y, method = "qda", value = "finalModel")
fit_qda$results

I should get TWO genes to drive the algorithm...

I am getting:

Something is wrong; all the Accuracy metric values are missing: Error: Stopping

1
Can you please provide an example of the data that you are using? I have never use the argument value in train and I have not found any reference in the documentation. What would that argument be suppose to do?c1au61o_HH
@c1au61o_HH The data is from dslabs.NelsonGon
Got it, not sure why I overlooked that info.c1au61o_HH
I cannot reproduce the error or train the mode. In my case I get that "some group is too small for 'qda' " (determined by the fact that the group placenta counts only 6 elements`c1au61o_HH

1 Answers

0
votes

Neither train() nor MASS::qda() have a value argument.

If you look, your code gives warnings:

Error: Stopping
In addition: There were 26 warnings (use warnings() to see them)

The warnings are:

some group is too small for 'qda'

QDA needs to be able to compute a full (non-singular) covariance matrix within each class and you don't have enough data (relative to your predictors) to do that in this examples