willtownes / naivebayes

High performance implementation of the Naive Bayes algorithm in R

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

naivebayes

CRAN_Status_Badge

Overview

naivebayes is an efficient implementation of the Naive Bayes algorithm in R.

Installation

install.packages("naivebayes")

# Or the the development version from GitHub:
devtools::install_github("majkamichal/naivebayes")

Usage

library(naivebayes)

data(iris)
nb <- naive_bayes(Species ~ ., data = iris)

tables(nb, which = "Sepal.Length")
#> $Sepal.Length
#>             
#> Sepal.Length    setosa versicolor virginica
#>         mean 5.0060000  5.9360000 6.5880000
#>         sd   0.3524897  0.5161711 0.6358796

plot(nb, which = "Sepal.Length")

head(predict(nb))
#> [1] setosa setosa setosa setosa setosa setosa
#> Levels: setosa versicolor virginica

About

High performance implementation of the Naive Bayes algorithm in R


Languages

Language:R 100.0%