{"id":19244415,"url":"https://github.com/ghazaleze/recommendersystem_lightfm","last_synced_at":"2025-06-13T01:33:56.916Z","repository":{"id":109419650,"uuid":"279785479","full_name":"GhazaleZe/RecommenderSystem_lightFM","owner":"GhazaleZe","description":"with Kaggle datasets","archived":false,"fork":false,"pushed_at":"2020-08-23T18:58:13.000Z","size":5708,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-01T12:49:17.492Z","etag":null,"topics":["dataset","lightfm","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GhazaleZe.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-07-15T06:31:25.000Z","updated_at":"2021-12-07T10:21:05.000Z","dependencies_parsed_at":"2023-04-25T06:03:03.874Z","dependency_job_id":null,"html_url":"https://github.com/GhazaleZe/RecommenderSystem_lightFM","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/GhazaleZe%2FRecommenderSystem_lightFM","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GhazaleZe%2FRecommenderSystem_lightFM/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GhazaleZe%2FRecommenderSystem_lightFM/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GhazaleZe%2FRecommenderSystem_lightFM/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GhazaleZe","download_url":"https://codeload.github.com/GhazaleZe/RecommenderSystem_lightFM/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250032502,"owners_count":21363850,"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":["dataset","lightfm","pandas","python","recommender-system"],"created_at":"2024-11-09T17:23:20.772Z","updated_at":"2025-06-13T01:33:56.900Z","avatar_url":"https://github.com/GhazaleZe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RecommenderSystem_lightFM :blush:\n## Overview:\nRecommender systems are a very popular topic in e-commerce. They are frameworks and engines which help us to implement a recommender system easier. One of these engines is [LightFM](https://making.lyst.com/lightfm/docs/home.html) which is a satisfiable python framework.  \nThis project is part of a 4-person team project, each person has worked on a special package my package has been **LightFM**.  \nYou can see our final report in **Final_Report_Group8.pdf**.\n## Goal:\nThe goal is to implement a recommender system with LightFM with 3 of [Kaggle](https://www.kaggle.com/) datasets.\n3 data set and their related files are:\n### 1.[Restaurant](https://www.kaggle.com/uciml/restaurant-data-with-consumer-ratings/metadata)   \nfiles:\n- collabrative_restaurant.py (main file)\n- geoplaces2.json\n- rating_final_U1011.json\n- userprofile.json\n- resturant_json.py\n### 2.Book\nfiles:\n- book.py (main file)\n- test_train.py\n- book_wrap_vs_BPR.py \n- book_eval_K_OS.py\n- mainbookup_lim1.json (10000 rows of main data in randomly picked)\n### 3.[Size for clothes](https://www.kaggle.com/rmisra/clothing-fit-dataset-for-size-recommendation/metadata)  \nfiles:\n- size_test\u0026trainWRAPvsBPR.py\n- size_test\u0026trainWRAP.py\n- random_pick.py\n- renttherunway_lim.json (10000 rows of main data in randomly picked)\n- sizeRs.py (main file)\n## Installation:\nI used **Conda** in **Pycharm** and install **LightFM** with:\n```\nconda install -c conda-forge lightfm\nconda install -c conda-forge/label/gcc7 lightfm\nconda install -c conda-forge/label/cf201901 lightfm\nconda install -c conda-forge/label/cf202003 lightfm \n```\n## Data and LightFM:\nOne of the most important challenges is how to give the data to the package. First, read the Json file and create a dataset of lightfm :\n```python\nf = open('rating_final_U1011.json', )\nff = open('userprofile.json', )\ndf = open(r'geoplaces2.json')\ndata_User = json.load(ff)\ndata_item = json.load(df)\ndata = json.load(f)\ndataset = Dataset()\n```\nThen fit the dataset with your data:\n```python\ndataset.fit((x['userID'] for x in data),\n            (x['placeID'] for x in data), (x['budget'] for x in data_User),(x['price'] for x in data_item))\n```\nNow it's possible to create the matrixes:\n```python\n(interactions, weights) = dataset.build_interactions(((x['userID'], x['placeID']) for x in data))\nprint(repr(interactions))\nuser_interactions = dataset.build_user_features((x['userID'], [x['budget']]) for x in data_User)\nprint(repr(user_interactions))\nitem_interactions = dataset.build_item_features((x['placeID'], [x['price']]) for x in data_item)\nprint(repr(item_interactions))\n```\nThis package is a model base package define and fit package:\n```python\nalpha = 1e-05\nepochs = 70\nnum_components = 32\nmodel = LightFM(no_components=num_components,\n                loss='warp',\n                learning_schedule='adadelta',\n                user_alpha=alpha,\n                item_alpha=alpha)\n```\nFor testing and validating the model you need to split data to test and train like in test_train.py.  \nTesting **learning_schedule** adadelta vs adagrad for cloth dataset:  \n\u003cimg width=\"448\" alt=\"Screenshot (994)\" src=\"https://user-images.githubusercontent.com/41547574/89573678-36f8c100-d840-11ea-892b-8c2a2d2f9ef1.png\"\u003e\n\nTesting **loss** WARP vs BPR for cloth dataset:\n\n\u003cimg width=\"448\" alt=\"Screenshot (995)\" src=\"https://user-images.githubusercontent.com/41547574/89574064-cbfbba00-d840-11ea-95ab-783682d9ef5a.png\"\u003e\n\n## Resourses:\nhttp://www2.informatik.uni-freiburg.de/~cziegler/BX/  \nhttps://making.lyst.com/lightfm/docs/home.html  \nhttps://github.com/lyst/lightfm  \n\n## Support:\nReach out to me at ghazalze@yahoo.com.  \nThanks [@alirezaomidi](https://github.com/alirezaomidi) :sweat_smile:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghazaleze%2Frecommendersystem_lightfm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghazaleze%2Frecommendersystem_lightfm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghazaleze%2Frecommendersystem_lightfm/lists"}