R/lda.r

Defines functions lda_classify lda_train

lda_train <- function(data){
  new.frm <- data.frame(data)
  z <- lda(formula=as.formula(paste("X", ncol(data), " ~ .", sep="")), data = new.frm, tol = sqrt(.Machine$double.eps))#, prior = rep(1, dimension)/dimension)
  return (z)
}

lda_classify <- function(objects, lda){
  z <- predict(lda, data.frame(objects))$class
  return (z)
}

Try the ddalpha package in your browser

Any scripts or data that you put into this service are public.

ddalpha documentation built on Oct. 1, 2024, 1:07 a.m.