{"id":23265742,"url":"https://github.com/andreip/naive-knn-classifiers","last_synced_at":"2025-04-06T07:34:04.505Z","repository":{"id":17025005,"uuid":"19789068","full_name":"andreip/Naive-KNN-Classifiers","owner":"andreip","description":"spam/ham (spamassassins) and sentiment analysis (kaggle) data","archived":false,"fork":false,"pushed_at":"2014-05-20T10:14:38.000Z","size":14112,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-12T12:57:02.134Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/andreip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-05-14T17:26:28.000Z","updated_at":"2020-09-26T12:02:26.000Z","dependencies_parsed_at":"2022-09-24T12:21:34.164Z","dependency_job_id":null,"html_url":"https://github.com/andreip/Naive-KNN-Classifiers","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreip%2FNaive-KNN-Classifiers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreip%2FNaive-KNN-Classifiers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreip%2FNaive-KNN-Classifiers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andreip%2FNaive-KNN-Classifiers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andreip","download_url":"https://codeload.github.com/andreip/Naive-KNN-Classifiers/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247450800,"owners_count":20940938,"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-12-19T15:32:18.323Z","updated_at":"2025-04-06T07:34:04.483Z","avatar_url":"https://github.com/andreip.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"NaiveBayes and KNN Classifiers\n=====\n\nThis is a homework assignment to work on two sets of data and apply two\nclassifiers: Naive Bayes and K-Nearest Neighbors.\n\nThe data sets are:\n  * [spam/ham from spamassassins](https://spamassassin.apache.org/publiccorpus/)\n  * [movie reviews rotten tomatoes from kaggle](http://www.kaggle.com/c/sentiment-analysis-on-movie-reviews/data)\n\nMy implementation of Naive Bayes works better on both data sets than KNN\n(tried k = {5,7,10}).\n\nI even submitted my try on Kaggle and ranked 114/202 (**0.57913 Kaggle score**,\nwhere 0.64993 is the currently best one). [See here](http://www.kaggle.com/c/sentiment-analysis-on-movie-reviews/leaderboard).\n\nFiles\n---\n\nThe code is self explanatory and commented, feel free to check it out.\n\n* main.py is where all code starts, obviously :)\n* classifiers/ contains both clasiifiers\n* parse/ contains the parsing of the sets of data (spam and movie reviews)\n\nTry it out for yourself\n----\n\nAll the datasets are included in the repo in `spamassassins/` and\n`rotten_tomatoes/` with training and testing data sets.\n\nThe spamassassins data sets are split in 70% training, 30% testing.\nThe rotten tomatoes data are used as got from kaggle directly, the\n`train.tsv` for training and the `test.tsv` for testing.\n\n```bash\n$ ./main.py mail naive     # runs the NaiveBayes classifier on email data\n                           # (included in repo)\n\n$ ./mail.py mail knn 5     # runs a 5-NN classifier on email data\n\n$ ./mail.py rotten naive   # runs a NaiveBayes classifier on the rotten\n                           # tomatoes data from kaggle\n\n$ ./mail.py rotten knn 7   # runs a 7-NN classifier on the rotten tomatoes\n                           # data from kaggle\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreip%2Fnaive-knn-classifiers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandreip%2Fnaive-knn-classifiers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandreip%2Fnaive-knn-classifiers/lists"}