Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
A Naive Bayes machine learning implementation in Elixir.
| Date | Stars |
|---|---|
| 2026-07-31 | 395 |
| 2026-08-02 | 395 |
| 2026-08-06 | 395 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# Simple Bayes [](https://travis-ci.org/fredwu/simple_bayes) [](https://coveralls.io/github/fredwu/simple_bayes?branch=master) [](https://hex.pm/packages/simple_bayes)
A [Naive Bayes](https://en.wikipedia.org/wiki/Naive_Bayes_classifier) machine learning implementation in Elixir.
> In machine learning, __naive Bayes classifiers__ are a family of simple probabilistic classifiers based on applying Bayes' theorem with strong (naive) independence assumptions between the features.
> Naive Bayes has been studied extensively since the 1950s. It was introduced under a different name into the text retrieval community in the early 1960s, and remains a popular (baseline) method for text categorization, the problem of judging documents as belonging to one category or the other (such as spam or legitimate, sports or politics, etc.) with word frequencies as the features. With appropriate preprocessing, it is competitive in this domain with more advanced methods including support vector machines. It also finds application in automatic medical diagnosis.
> Naive Bayes classifiers are highly scalable, requiring a number of parameters linear in the number of variables (features/predictors) in a learning problem. Maximum-likelihood training can be done by evaluating a closed-form expression, which takes linear time, rather than by expensive iterative approximation as used for many other types of classifiers. - [Wikipedia](https://en.wikipedia.org/wiki/Naive_Bayes_classifier)
## Features
- Naive Bayes algorithm with different models
- Multinomial
- Binarized (boolean) multinomial
- Bernoulli
- Multiple storage options
- In-memory (default)
- File system
- [Dets](http://erlang.org/doc/man/dets.html) (Disk-based Erlang Term Storage)
- Ignores stop words
- [Additive smoothing](https://en.wikipedia.org/wiki/Additive_smoothing)
- [TF-IDF](https://en.wikipedia.org/wiki/Tf-idf)
- Optional keywords weighting
- Optional word [stemming](https://en.wikipedia.org/wiki/Stemming) via [Stemmer](https://github.com/fredwu/stemmer)
### Feature Matrix
| | Multinomial | Binarized multinomial | Bernoulli |
|--------------------|-------------|-----------------------|-----------|
| Stop words | ✅ | ✅ | ✅ |
| Additive smoothing | ✅ | ✅ | |
| TF-IDF | ✅ | | |
| Keywords weighting | ✅ | | |
| Stemming | ✅ | ✅ | ✅ |
## Usage
Install by adding `:simple_bayes` and optionally `:stemmer` (for the default
stemming functionality) to `deps` in your
`mix.exs`:
```elixir
defp deps do
[
{:simple_bayes, "~> 0.12"},
{:stemmer, "~> 1.0"}
]
end
```
If you're on Elixir 1.3 or below, ensure `:simple_bayes` and optionally
`:stemmer` are started before your application:
```elixir
def application do
[applications: [:logger, :simple_bayes, :stemmer]]
end
```
```elixir
bayes = SimpleBayes.init()
|> SimpleBayes.train(:apple, "red sweet")
|> SimpleBayes.train(:apple, "green", weight: 0.5)
|> SimpleBayes.train(:apple, "round", weight: 2)
|> SimpleBayes.train(:banana, "sweet")
|> SimpleBayes.train(:banana, "green", weight: 0.5)
|> SimpleBayes.train(:banana, "yellow long", weight: 2)
|> SimpleBayes.train(:orange, "red")
|> SimpleBayes.train(:orange, "yellow sweet", weight: 0.5)
|> SimpleBayes.train(:orange, "round", weight: 2)
bayes |> SimpleBayes.classify_one("Maybe green maybe red but definitely round and sweet.")
# => :apple
bayes |> SimpleBayes.classify("Maybe green maybe red but definitely round and sweet.")
# => [
# apple: 0.18519202529366116,
# orange: Excerpt of 9,567 characters
Read on GitHubWould you bet a product on this? Bounded 0–100 and slow moving.
matched fp:55fc9bfcfc4975d3, llm:Repository topics: bayes, classifier, machine-learning, naive-bayes-classifier; description/readme: 'A Naive Bayes machine learning implementation in Elixir' with Multinomial/Bernoulli models and storage options.
matched fp:55fc9bfcfc4975d3, llm:Repository topics: bayes, classifier, machine-learning, naive-bayes-classifier; description/readme: 'A Naive Bayes machine learning implementation in Elixir' with Multinomial/Bernoulli models and storage options.