https://github.com/gbroques/naive-bayes
A Python implementation of Naive Bayes from scratch.
https://github.com/gbroques/naive-bayes
classification data-mining data-mining-algorithms laplace-smoothing log-likelihood maximum-a-posteriori-estimation maximum-likelihood-estimation naive naive-algorithm naive-bayes naive-bayes-algorithm naive-bayes-classification naive-bayes-classifier naive-bayes-implementation naive-bayes-tutorial naivebayes python python3
Last synced: about 2 months ago
JSON representation
A Python implementation of Naive Bayes from scratch.
- Host: GitHub
- URL: https://github.com/gbroques/naive-bayes
- Owner: gbroques
- License: mit
- Created: 2018-02-01T13:54:57.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-03-27T14:56:31.000Z (over 7 years ago)
- Last Synced: 2023-03-01T09:56:27.077Z (over 2 years ago)
- Topics: classification, data-mining, data-mining-algorithms, laplace-smoothing, log-likelihood, maximum-a-posteriori-estimation, maximum-likelihood-estimation, naive, naive-algorithm, naive-bayes, naive-bayes-algorithm, naive-bayes-classification, naive-bayes-classifier, naive-bayes-implementation, naive-bayes-tutorial, naivebayes, python, python3
- Language: Python
- Homepage:
- Size: 61.5 KB
- Stars: 31
- Watchers: 3
- Forks: 27
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Naive Bayes from Scratch in Python
[](https://travis-ci.org/gbroques/naive-bayes)
A custom implementation of a Naive Bayes Classifier written from scratch in Python 3.
[](http://www.saedsayad.com/naive_bayesian.htm)
From [Wikipedia](https://en.wikipedia.org/wiki/Naive_Bayes_classifier):
> 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.
## Dataset
#### Loan Defaulters
| Home Owner | Marital Status | Annual Income | Defaulted Borrower |
| ---------- | -------------- | ------------- | ------------------ |
| Yes | Single | $125,000 | No |
| No | Married | $100,000 | No |
| No | Single | $70,000 | No |
| Yes | Married | $120,000 | No |
| No | Divorced | $95,000 | Yes |
| No | Married | $60,000 | No |
| Yes | Divorced | $220,000 | No |
| No | Single | $85,000 | Yes |
| No | Married | $75,000 | No |
| No | Single | $90,000 | Yes |**Source:** *Introduction to Data Mining* (1st Edition) by Pang-Ning Tan
Figure 5.9, Page 230
## How to Run
Please run with Python 3 or greater.`python main`