{"id":37073018,"url":"https://github.com/artdgn/ml-recsys-tools","last_synced_at":"2026-01-14T08:34:20.050Z","repository":{"id":57442366,"uuid":"286675100","full_name":"artdgn/ml-recsys-tools","owner":"artdgn","description":"Tools for development of recommendation systems in Python.","archived":false,"fork":true,"pushed_at":"2020-08-28T20:20:28.000Z","size":2510,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-29T00:49:49.480Z","etag":null,"topics":["implicit-feedback","lightfm-library","machine-learning","matrix-factorization","python","recommender-systems"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"DomainGroupOSS/ml-recsys-tools","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/artdgn.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":"2020-08-11T07:24:19.000Z","updated_at":"2021-01-09T12:08:07.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/artdgn/ml-recsys-tools","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/artdgn/ml-recsys-tools","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artdgn%2Fml-recsys-tools","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artdgn%2Fml-recsys-tools/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artdgn%2Fml-recsys-tools/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artdgn%2Fml-recsys-tools/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artdgn","download_url":"https://codeload.github.com/artdgn/ml-recsys-tools/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artdgn%2Fml-recsys-tools/sbom","scorecard":{"id":208929,"data":{"date":"2025-08-11","repo":{"name":"github.com/artdgn/ml-recsys-tools","commit":"96a359f4ae9aead16db20cc6f157d128837c317d"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yaml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/artdgn/ml-recsys-tools/ci.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yaml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/artdgn/ml-recsys-tools/ci.yaml/master?enable=pin","Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating python:3.6-slim to python:3.6-slim@sha256:2cfebc27956e6a55f78606864d91fe527696f9e32a724e6f9702b5f9602d0474","Warn: pipCommand not pinned by hash: Dockerfile:5-6","Warn: pipCommand not pinned by hash: Dockerfile:5-6","Warn: pipCommand not pinned by hash: Dockerfile:14","Warn: pipCommand not pinned by hash: .github/workflows/ci.yaml:17","Warn: pipCommand not pinned by hash: .github/workflows/ci.yaml:18","Warn: pipCommand not pinned by hash: .github/workflows/ci.yaml:19","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   6 pipCommand dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"54 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2022-42986 / GHSA-43fp-rhv2-5gv8","Warn: Project is vulnerable to: PYSEC-2023-135 / GHSA-xqr8-7jwr-rhp7","Warn: Project is vulnerable to: PYSEC-2024-60 / GHSA-jjg7-2v4v-x38h","Warn: Project is vulnerable to: PYSEC-2022-288 / GHSA-6hrg-qmvc-2xh8","Warn: Project is vulnerable to: PYSEC-2024-231 / GHSA-2586-f3p4-hq84","Warn: Project is vulnerable to: GHSA-6p56-wp2h-9hxr","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: GHSA-3f63-hfp8-52jq","Warn: Project is vulnerable to: PYSEC-2021-41 / GHSA-3wvg-mj6g-m9cv","Warn: Project is vulnerable to: GHSA-44wm-f244-xhp3","Warn: Project is vulnerable to: GHSA-4fx9-vc88-q2xc","Warn: Project is vulnerable to: PYSEC-2021-35 / GHSA-57h3-9rgr-c24m","Warn: Project is vulnerable to: PYSEC-2021-331 / GHSA-7534-mm45-c74v","Warn: Project is vulnerable to: PYSEC-2021-137 / GHSA-77gc-v2xv-rvvh","Warn: Project is vulnerable to: PYSEC-2021-92 / GHSA-7r7m-5h27-29hp","Warn: Project is vulnerable to: PYSEC-2023-227 / GHSA-8ghj-p4vj-mr35","Warn: Project is vulnerable to: PYSEC-2022-10 / GHSA-8vj2-vxx3-667w","Warn: Project is vulnerable to: PYSEC-2021-36 / GHSA-8xjq-8fcg-g5hw","Warn: Project is vulnerable to: PYSEC-2021-42 / GHSA-95q3-8gr9-gm8w","Warn: Project is vulnerable to: PYSEC-2021-317 / GHSA-98vv-pw6r-q6q4","Warn: Project is vulnerable to: PYSEC-2021-38 / GHSA-9hx2-hgq2-2g4f","Warn: Project is vulnerable to: PYSEC-2022-168 / GHSA-9j59-75qj-795w","Warn: Project is vulnerable to: PYSEC-2021-40 / GHSA-f4w8-cv6p-x6r5","Warn: Project is vulnerable to: PYSEC-2021-69 / GHSA-f5g8-5qq7-938w","Warn: Project is vulnerable to: PYSEC-2021-139 / GHSA-g6rj-rv7j-xwp4","Warn: Project is vulnerable to: PYSEC-2021-71 / GHSA-hf64-x4gq-p99h","Warn: Project is vulnerable to: PYSEC-2021-94 / GHSA-hjfx-8p6c-g7gx","Warn: Project is vulnerable to: GHSA-j7hp-h8jx-5ppr","Warn: Project is vulnerable to: GHSA-jgpv-4h4c-xhw3","Warn: Project is vulnerable to: PYSEC-2022-42979 / GHSA-m2vv-5vj5-2hm7","Warn: Project is vulnerable to: PYSEC-2021-37 / GHSA-mvg9-xffr-p774","Warn: Project is vulnerable to: PYSEC-2021-39 / GHSA-p43w-g3c5-g5mq","Warn: Project is vulnerable to: PYSEC-2022-8 / GHSA-pw3c-h7wp-cvhx","Warn: Project is vulnerable to: PYSEC-2021-93 / GHSA-q5hq-fp76-qmrc","Warn: Project is vulnerable to: PYSEC-2021-138 / GHSA-rwv7-3v45-hg29","Warn: Project is vulnerable to: PYSEC-2021-70 / GHSA-vqcj-wrf2-7v73","Warn: Project is vulnerable to: PYSEC-2022-9 / GHSA-xrcv-f9gm-v42c","Warn: Project is vulnerable to: PYSEC-2023-175","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2023-74 / GHSA-j8r2-6x86-q33q","Warn: Project is vulnerable to: PYSEC-2024-110 / GHSA-jw8x-6495-233v","Warn: Project is vulnerable to: PYSEC-2020-108 / GHSA-jxfp-4rvq-9h9m","Warn: Project is vulnerable to: PYSEC-2023-102","Warn: Project is vulnerable to: PYSEC-2023-114","Warn: Project is vulnerable to: GHSA-g7vv-2v7x-gj9p","Warn: Project is vulnerable to: GHSA-34jh-p97f-mpxf","Warn: Project is vulnerable to: PYSEC-2023-212 / GHSA-g4mx-q9vg-27p4","Warn: Project is vulnerable to: GHSA-pq67-6m6q-mj2v","Warn: Project is vulnerable to: PYSEC-2021-108 / GHSA-q2q7-5pp4-w6pg","Warn: Project is vulnerable to: PYSEC-2023-192 / GHSA-v845-jxx5-vc9f","Warn: Project is vulnerable to: PYSEC-2020-92 / GHSA-hj5v-574p-mj7c","Warn: Project is vulnerable to: PYSEC-2022-42969","Warn: Project is vulnerable to: GHSA-jfmj-5v4g-7637"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T00:21:31.008Z","repository_id":57442366,"created_at":"2025-08-17T00:21:31.008Z","updated_at":"2025-08-17T00:21:31.008Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414393,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:31:27.429Z","status":"ssl_error","status_checked_at":"2026-01-14T08:31:19.098Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["implicit-feedback","lightfm-library","machine-learning","matrix-factorization","python","recommender-systems"],"created_at":"2026-01-14T08:34:19.279Z","updated_at":"2026-01-14T08:34:20.038Z","avatar_url":"https://github.com/artdgn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![CI](https://github.com/artdgn/ml-recsys-tools/workflows/CI/badge.svg) ![PyPI](https://img.shields.io/pypi/v/ml-recsys-tools?color=blue)\n\n# ml-recsys-tools\n\n----\n\n## This is an updated version of the [stale ml-recsys-tools source repo](https://github.com/DomainGroupOSS/ml-recsys-tools)\n\n-----\n\n\n## Open source repo for various tools for recommender systems development work.\nMain purpose is to provide a single wrapper for various recommender packages to train, tune, evaluate and get data in and recommendations / similarities out.\n\n## Installation:\n\nPip:\n* PyPi: `pip install ml-recsys-tools` \n* Github `master`: `pip install git+https://github.com/artdgn/ml-recsys-tools@master#egg=ml_recsys_tools`\n\n\n## Basic usage:\n\n```python\n# dataset: download and prepare dataframes\nfrom ml_recsys_tools.datasets.prep_movielense_data import get_and_prep_data\nrating_csv_path, users_csv_path, movies_csv_path = get_and_prep_data()\n\n# read the interactions dataframe and create a data handler object and  split to train and test\nimport pandas as pd\n\nratings_df = pd.read_csv(rating_csv_path)\nfrom ml_recsys_tools.data_handlers.interaction_handlers_base import ObservationsDF    \nobs = ObservationsDF(ratings_df, uid_col='userid', iid_col='itemid')\ntrain_obs, test_obs = obs.split_train_test(ratio=0.2)\n\n# train and test LightFM recommender\nfrom ml_recsys_tools.recommenders.lightfm_recommender import LightFMRecommender    \nlfm_rec = LightFMRecommender()\nlfm_rec.fit(train_obs, epochs=10)\n\n# print summary evaluation report:\nprint(lfm_rec.eval_on_test_by_ranking(test_obs.df_obs, prefix='lfm ', n_rec=100))\n\n# get all recommendations and print a sample (training interactions are filtered out by default)\nrecs = lfm_rec.get_recommendations(lfm_rec.all_users, n_rec=5)\nprint(recs.sample(5))\n\n# get all similarities and print a sample\nsimils = lfm_rec.get_similar_items(lfm_rec.all_items, n_simil=5)\nprint(simils.sample(10))\n```\n   \n## Additional examples in the `examples/` folder:\n - [Cosine similarity](https://github.com/artdgn/ml-recsys-tools/blob/master/examples/cosine_similarity.py) \n - [Ensembles](https://github.com/artdgn/ml-recsys-tools/blob/master/examples/ensembles.py) \n - [Hybrid features for LightFM](https://github.com/artdgn/ml-recsys-tools/blob/master/examples/lightfm_hybrid_features.py) \n - [Additional recommenders](https://github.com/artdgn/ml-recsys-tools/blob/master/examples/additional_recommenders.py) \n - [Using multiple testsets](https://github.com/artdgn/ml-recsys-tools/blob/master/examples/multiple_testsets.py)\n and [Evaluation](https://github.com/artdgn/ml-recsys-tools/blob/master/examples/evaluation.py)\n\n\n## Recommender models and tools:\n\n* #### [LightFM](https://github.com/lyst/lightfm) package based recommender.\n* #### [Implicit](https://github.com/benfred/implicit) package based ALS recommender.\n* #### Evaluation features added for most recommenders:\n    * Dataframes for all inputs and outputs\n        * adding external features (for LightFM hybrid mode)\n        * fast batched methods for:\n            * user recommendation sampling\n            * similar items samplilng with different similarity measures\n            * similar users sampling\n            * evaluation by sampling and ranking\n            * dense user x item recommendation and item x item similarity      \n                  \n* #### Additional recommender models:\n    * ##### Similarity based:\n        * cooccurence (items, users)\n        * generic similarity based (can be used with external features)  \n              \n* #### Ensembles:\n    * subdivision based (multiple recommenders each on subset of data - e.g. geographical region):\n        * geo based: simple grid, equidense grid, geo clustering\n        * LightFM and cooccurrence based\n    * combination based - combining recommendations from multiple recommenders\n    * similarity combination based - similarity based recommender on similarities from multiple recommenders\n    * cascade ensemble \n           \n* #### Interaction dataframe and sparse matrix handlers / builders:\n    * sampling, data splitting,\n    * external features matrix creation (additional item features),\n        with feature engineering: binning / one*hot encoding (via pandas_sklearn)\n    * evaluation and ranking helpers\n    * handlers for observations coupled with external features and features with geo coordinates\n        \n* #### Evaluation utils:\n    * score reports on lightfm metrics (AUC, precision, recall, reciprocal)\n    * n-DCG, and n-MRR metrics, n-precision / recall\n    * references: best possible ranking and chance ranking\n\n* #### Utilities:\n    * similarity calculation helpers (similarities, dot, top N, top N on sparse)\n    * parallelism utils\n    * sklearn transformer extenstions (for feature engineering)\n    * logging, debug printouts decorators and other instrumentation and inspection tools\n    * pandas utils\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartdgn%2Fml-recsys-tools","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartdgn%2Fml-recsys-tools","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartdgn%2Fml-recsys-tools/lists"}