{"id":19010784,"url":"https://github.com/darthsim/bayes_classifier","last_synced_at":"2025-07-13T14:38:54.025Z","repository":{"id":62554037,"uuid":"13004515","full_name":"DarthSim/bayes_classifier","owner":"DarthSim","description":"Naive Bayes classifier","archived":false,"fork":false,"pushed_at":"2013-09-22T01:13:32.000Z","size":160,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-26T12:06:44.328Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/DarthSim/bayes_classifier","language":"Ruby","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/DarthSim.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-09-22T00:02:46.000Z","updated_at":"2014-11-20T16:04:37.000Z","dependencies_parsed_at":"2022-11-03T05:00:23.930Z","dependency_job_id":null,"html_url":"https://github.com/DarthSim/bayes_classifier","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/DarthSim/bayes_classifier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarthSim%2Fbayes_classifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarthSim%2Fbayes_classifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarthSim%2Fbayes_classifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarthSim%2Fbayes_classifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DarthSim","download_url":"https://codeload.github.com/DarthSim/bayes_classifier/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DarthSim%2Fbayes_classifier/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265157255,"owners_count":23719881,"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":[],"created_at":"2024-11-08T19:12:30.050Z","updated_at":"2025-07-13T14:38:54.006Z","avatar_url":"https://github.com/DarthSim.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bayes::Classifier\n\nBayes::Classifier allows you to classify strings with naive Bayes classifier.\n\n## Installation\n\nJust add the following line to your `Gemfile`:\n\n```ruby\ngem 'bayes_classifier'\n```\n\nThen run 'bundle install'.\n\n## Usage\n\n```ruby\n# Create new classifier\nclassifier = Bayes::Classifier.new\n\n# Train classifier with a string\nclassifier.train :category1, \"lorem ipsum dolor sit amet\"\n\n# Train classifier with array of strings\nclassifier.train_with_array :category2, [\"the first string\", \"the second string\", \"the third string\"]\n\n# Train classifier with textfile\nclassifier.train_with_file :category3, \"data/category3.txt\"\n\n# Train classifier with CSV file (first column - string, second column - category)\nclassifier.train_with_csv \"data/training.csv\"\n\n# Apply weighting to the top words of category\nclassifier.apply_weighting :category3, 10\n\n# Remove empty categories\nclassifier.pop_unused\n\n# Classify string\nclassifier.classify \"the string\"\n\n# Reset categories\nclassifier.flush\n\n# Remove all categories\nclassifier.flush_all\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (git checkout -b my-new-feature)\n3. Commit your changes (git commit -am 'Add some feature')\n4. Push to the branch (git push origin my-new-feature)\n5. Create new Pull Request","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarthsim%2Fbayes_classifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdarthsim%2Fbayes_classifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdarthsim%2Fbayes_classifier/lists"}