{"id":31740384,"url":"https://github.com/aliyahscoding/tiny-recommender","last_synced_at":"2026-05-09T05:32:56.993Z","repository":{"id":317619886,"uuid":"1068155979","full_name":"aliyahscoding/tiny-recommender","owner":"aliyahscoding","description":"Tiny item-item recommender in Python using cosine similarity over a toy user–item matrix. Simple CLI to print top-N recommendations.","archived":false,"fork":false,"pushed_at":"2025-10-02T00:18:05.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-09T10:18:29.286Z","etag":null,"topics":["collaborative-filtering","cosine-similarity","numpy","pandas","python","recommender-system"],"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/aliyahscoding.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-02T00:06:26.000Z","updated_at":"2025-10-02T00:18:08.000Z","dependencies_parsed_at":"2025-10-02T02:36:28.271Z","dependency_job_id":"46c7174c-f3d2-4ae4-9342-06c1364e6244","html_url":"https://github.com/aliyahscoding/tiny-recommender","commit_stats":null,"previous_names":["aliyahscoding/tiny-recommender"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aliyahscoding/tiny-recommender","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyahscoding%2Ftiny-recommender","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyahscoding%2Ftiny-recommender/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyahscoding%2Ftiny-recommender/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyahscoding%2Ftiny-recommender/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aliyahscoding","download_url":"https://codeload.github.com/aliyahscoding/tiny-recommender/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aliyahscoding%2Ftiny-recommender/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32808444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"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":["collaborative-filtering","cosine-similarity","numpy","pandas","python","recommender-system"],"created_at":"2025-10-09T10:18:27.796Z","updated_at":"2026-05-09T05:32:56.962Z","avatar_url":"https://github.com/aliyahscoding.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Tiny Item-Item Recommender\n\nA minimal, portfolio-friendly item–item collaborative filtering demo in Python. It builds a user–item matrix from a toy dataset, computes cosine similarity between items, and recommends top-N items for a chosen user.\n\n## How it works\n\n1. **User–item matrix**: pivot ratings into a matrix (users as rows, items as columns). Missing ratings are treated as 0.  \n2. **Item–item similarity**: compute cosine similarity between item vectors:\n\n   $$\n   \\cos(\\theta) = \\frac{\\mathbf{x}\\cdot\\mathbf{y}}{\\lVert \\mathbf{x}\\rVert\\,\\lVert \\mathbf{y}\\rVert}\n   $$\n\n3. **Scoring**: for each unseen item \\(j\\),\n   \\[\n   \\text{score}(j)=\\sum_i \\text{sim}(j,i)\\times \\text{rating}(u,i)\n   \\]\n   then normalize by the total similarity weight to avoid popularity bias.\n\n## Quickstart\n```bash\n# 1) Create toy ratings (writes to data/ratings.csv)\npython recommender.py --generate-data\n\n# 2) Get top-5 recommendations for user U3\npython recommender.py --user U3 --top_n 5\n```\n\n## Use scikit-learn's implementation if you prefer:\n```bash\npip install scikit-learn\npython recommender.py --user U3 --top_n 5 --method sklearn\n```\n\n## Example Output\n```bash\n=== Tiny Recommender ===\nUser: U3\n item_id  score\n I7       0.8123\n I2       0.7035\n I9       0.6461\n I4       0.5902\n I1       0.5718\n```\n(Number's will differ because toy data is different)\n\n## Files\n**recommender.py** — all logic and a tiny CLI\n**data/ratings.csv** — toy ratings (auto-generated)\n**requirements.txt** — dependencies\n**.gitignore** — keeps the repo clean\n\n## Data format\nLong-form CSV with three columns:\nuser_id\titem_id\trating\nU1\tI3\t4\nU1\tI7\t5\nU2\tI1\t2\n\n\n## Notes\nIntentionally tiny and readable. Good for explaining item–item CF in interviews.\nEasy extensions: user-based CF, top-K neighbors, or a simple train/test split with evaluation metrics.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliyahscoding%2Ftiny-recommender","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faliyahscoding%2Ftiny-recommender","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faliyahscoding%2Ftiny-recommender/lists"}