[R] predict.lda is missing ?

Weiwei Shi helprhelp at gmail.com
Sat Nov 11 05:42:37 CET 2006


i think you should use
lda_res <- lda(over_win ~ t1_scrd_a + t1_alwd_a, data=train, CV=F)

loo should be disabled for predicting purpose.

On 11/10/06, Larry White <ljw1001 at gmail.com> wrote:
> I'm trying to classify some observations using lda and I'm getting a
> strange error.  I loaded the MASS package and created a model like so:
>
> >train <- mod1[mod1$rand < 1.7,]
> >classify <- mod1[mod1$rand >= 1.7,]
> >lda_res <- lda(over_win ~ t1_scrd_a + t1_alwd_a, data=train, CV=TRUE)
>
> That works, and all is well until I try to do a prediction for the holdouts:
>
> >lda_pred <- predict(lda_res, classify)$class
> Error in predict(lda_res, classify) : no applicable method for "predict"
>
> If I try predict.lda specifically I get
> > lda_pred <- predict.lda(lda_res, classify)$class
> Error: could not find function "predict.lda"
> > predict.lda
> Error: object "predict.lda" not found
> but i can get help for it by typing help(predict.lda), which says it's
> in the MASS package.
>
> If somebody could point out what I'm doing wrong I'd be grateful.
> thanks
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>


-- 
Weiwei Shi, Ph.D
Research Scientist
GeneGO, Inc.

"Did you always know?"
"No, I did not. But I believed..."
---Matrix III



More information about the R-help mailing list