fltbl <- FLTable("tblNBData", "ObsID", "VarID", "NUM_VAL") flmod <-naiveBayes(object = fltbl, formula = ~.) rtbl <- iris rtbl$Species <- sample(x = 2, size = length(rtbl$Species), replace = TRUE)-1 rtbl$Species <- as.numeric(rtbl$Species) colnames(rtbl) <- tolower(colnames(rtbl)) fliris <- as.FLTable(rtbl,tableName = getOption("TestTempTableName"),temporary=F, drop = TRUE) flmod <-naiveBayes.FLTable(data = fliris, formula = species~., laplace = 1) rmod <-naiveBayes(data = rtbl, formula = species~.) rtbl <- as.data.frame(Titanic) rtbl <- rtbl[,-5] rtbl <- as.data.frame(lapply(rtbl, function(i)as.numeric(i)-1)) colnames(rtbl)[[1]] <- "vcl" rmod <- naiveBayes(Survived~.,rtbl) fltbl <- as.FL(rtbl) flmod <- naiveBayes.FLTable(formula = Survived~., data = fltbl)
1 2 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.