Displaying 1 result from an estimated 1 matches for "testsetdf".
Did you mean:
testset
2012 Mar 22
1
predict () for LDA and GLM
...classification. My training
set is 70 rows long with 32 features, and my test set is 30 rows long with
32 features.
Using Naive Bayes, I can train a model, and then predict the test set with
it like so:
ass4q1.dLDA = lda(ass4q1.trainSet[,1]~ass4q1.trainSet[,2:3])
table(predict(ass4q1.dNB, ass4q1.testSetDF[,2:3]), ass4q1.testSetDF[,1])
However, when the same is done for LDA or GLM, suddenly it tells me that the
number of rows doesn't match and doesn't predict my test data. The error for
GLM, as an example, is:
Error in table(predict(ass4q1.dGLM, ass4q1.testSetDF[, 2:3]),
ass4q1.testSetDF[,...