{"id":28629774,"url":"https://github.com/codebox/bayesian-classifier","last_synced_at":"2025-06-12T12:13:34.371Z","repository":{"id":5544827,"uuid":"6748770","full_name":"codebox/bayesian-classifier","owner":"codebox","description":"A Naive Bayesian Classifier written in Python","archived":false,"fork":false,"pushed_at":"2016-10-24T16:28:38.000Z","size":23,"stargazers_count":102,"open_issues_count":3,"forks_count":45,"subscribers_count":15,"default_branch":"master","last_synced_at":"2023-11-07T21:04:21.334Z","etag":null,"topics":["bayes-classifier","classifier","classify-documents","python"],"latest_commit_sha":null,"homepage":"https://codebox.net/pages/naive-bayesian-classifier-in-python","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/codebox.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":"2012-11-18T16:53:24.000Z","updated_at":"2023-09-08T16:36:18.000Z","dependencies_parsed_at":"2022-09-23T22:00:41.973Z","dependency_job_id":null,"html_url":"https://github.com/codebox/bayesian-classifier","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/codebox/bayesian-classifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebox%2Fbayesian-classifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebox%2Fbayesian-classifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebox%2Fbayesian-classifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebox%2Fbayesian-classifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codebox","download_url":"https://codeload.github.com/codebox/bayesian-classifier/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebox%2Fbayesian-classifier/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259462578,"owners_count":22861514,"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","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":["bayes-classifier","classifier","classify-documents","python"],"created_at":"2025-06-12T12:13:33.738Z","updated_at":"2025-06-12T12:13:34.357Z","avatar_url":"https://github.com/codebox.png","language":"Python","readme":"Naive Bayesian Classifier\n=========================\nThis is an implementation of a Naive Bayesian Classifier written in Python. The utility uses statistical methods to classify documents, based on the words that appear within them. A common application for this type of software is in email spam filters.\n\nThe utility must first be 'trained' using large numbers of pre-classified documents, during the training phase a database is populated with information about how often certain words appear in each type of document. Once training is complete, unclassified documents can be submitted to the classifier which will return a value between 0 and 1, indicating the probablity that the document belongs to one class of document rather than another.\n\nTraining\n--------\n\nTo train the utility, use the following command:\n\n    python bayes.py learn \u003cdoctype\u003e \u003cfile\u003e \u003ccount\u003e\n\n+ The *doctype* argument can be any non-empty value - this is just the name you have chosen for the type of document that you are showing to the classifier\n+ The *file* argument indicates the location of the file containing the training data that you wish to use\n+ The *count* argument is a numeric value indicating the number of separate documents contained in the training data file\n\nFor example:\n\n    python bayes.py learn spam all_my_spam.txt 10000\n    python bayes.py learn ham inbox.txt 10000\n\nClassification\n--------------\n\nOnce training is complete, classification is performed using this command:\n\n    python bayes.py classify \u003cfile\u003e \u003cdoctype\u003e \u003cdoctype\u003e\n\n+ The *file* argument indicates the location of the file containing the document to be classified\n+ The two *doctype* arguments are the names of the document types against which the input file will be compared\n\nFor example:\n\n    python bayes.py classify nigerian_finance_email.txt spam ham\n    \u003e Probability that document is spam rather than ham is 0.98\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebox%2Fbayesian-classifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodebox%2Fbayesian-classifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebox%2Fbayesian-classifier/lists"}