{"id":19974314,"url":"https://github.com/gbroques/naive-bayes","last_synced_at":"2025-10-15T23:07:00.841Z","repository":{"id":53858052,"uuid":"119842565","full_name":"gbroques/naive-bayes","owner":"gbroques","description":"A Python implementation of Naive Bayes from scratch.","archived":false,"fork":false,"pushed_at":"2018-03-27T14:56:31.000Z","size":63,"stargazers_count":39,"open_issues_count":0,"forks_count":27,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-12T18:51:50.455Z","etag":null,"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"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gbroques.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-01T13:54:57.000Z","updated_at":"2025-06-12T13:59:53.000Z","dependencies_parsed_at":"2022-08-23T20:21:42.577Z","dependency_job_id":null,"html_url":"https://github.com/gbroques/naive-bayes","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/gbroques/naive-bayes","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbroques%2Fnaive-bayes","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbroques%2Fnaive-bayes/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbroques%2Fnaive-bayes/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbroques%2Fnaive-bayes/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gbroques","download_url":"https://codeload.github.com/gbroques/naive-bayes/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gbroques%2Fnaive-bayes/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279125692,"owners_count":26109196,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["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"],"created_at":"2024-11-13T03:14:35.573Z","updated_at":"2025-10-15T23:07:00.825Z","avatar_url":"https://github.com/gbroques.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Naive Bayes from Scratch in Python\n\n[![Build Status](https://travis-ci.org/gbroques/naive-bayes.svg?branch=master)](https://travis-ci.org/gbroques/naive-bayes)\n\nA custom implementation of a Naive Bayes Classifier written from scratch in Python 3.\n\n[![Bayes Theorem](bayes-theorem.png)](http://www.saedsayad.com/naive_bayesian.htm)\n\nFrom [Wikipedia](https://en.wikipedia.org/wiki/Naive_Bayes_classifier):\n\n\u003e 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.\n\n## Dataset\n\n#### Loan Defaulters\n\n| Home Owner | Marital Status | Annual Income | Defaulted Borrower |\n| ---------- | -------------- | ------------- | ------------------ |\n| Yes        | Single         | $125,000      | No                 |\n| No         | Married        | $100,000      | No                 |\n| No         | Single         | $70,000       | No                 |\n| Yes        | Married        | $120,000      | No                 |\n| No         | Divorced       | $95,000       | Yes                |\n| No         | Married        | $60,000       | No                 |\n| Yes        | Divorced       | $220,000      | No                 |\n| No         | Single         | $85,000       | Yes                |\n| No         | Married        | $75,000       | No                 |\n| No         | Single         | $90,000       | Yes                |\n\n**Source:** *Introduction to Data Mining* (1st Edition) by Pang-Ning Tan\n\nFigure 5.9, Page 230\n\n## How to Run\nPlease run with Python 3 or greater.\n\n`python main`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbroques%2Fnaive-bayes","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgbroques%2Fnaive-bayes","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgbroques%2Fnaive-bayes/lists"}