Repository navigation
01 mixed hybrid model - #2225
Closed
UrteUrbonaviciute wants to merge 11 commits into
Closed
UrteUrbonaviciute wants to merge 11 commits into
UrteUrbonaviciute wants to merge 11 commits into
Conversation
…king task, with also some bug fixes related to the ModelType + numpy and torch
This reverts commit 3451a9d. (im stupid)
… model, as well as logging the results
…-model 1.1 Individual Model: Content Based Recommender
…model Task 1.1 and 1.2 training and tuning models
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Mixed Hybrid recommender that combines the ranked top-10 lists of three different kinds of model:
It is separate from the Logistic Regression weighted hybrid. It does not combine scores, because the three models' scores are on different scales. It mixes their ranked lists instead.
How it works
ItemKNN=4 BPR=4 ContentBased=2, and repeats until each user has 10 movies. A plain round-robin (one movie per model per round) is included as a baseline.run_model.py, which already hides training movies (validation) and training + validation movies (test). The hybrid uses the same split and ground truth as every other model.item_id.Changes
mixed_hybrid.py: the mixing and evaluation code. The evaluation gives the same numbers as RecBole for ItemKNN and BPR, so comparisons are fair.tune_mixed_hybrid.py: tries round-robin and 9 share splits on validation, picks the best by NDCG@10, and saves it toconfigs/mixed_hybrid_best.yaml.run_mixed_hybrid.py: runs that saved split once on test and compares it with each model on its own.configs/models/ContentBased.yaml: runs the existingCBmodel unchanged throughrun_model.py. No changes to the CB model code or tocommon.py.tests/test_mixed_hybrid.py: tests for duplicates, shares, keeping users separate, missing models, top-k and determinism.README.md: how to reproduce the results, plus the results.Results (ML-100K, seed 2020, ratings ≥ 3)
Validation, a selection of the 10 options tried:
Test, evaluated once with the selected split:
The hybrid does not beat BPR on its own. ContentBased is roughly 8x weaker than the collaborative models, so every slot it gets mostly replaces a correct movie from ItemKNN or BPR. On validation, scores drop each time ContentBased gets more slots.
How to reproduce
cd project python run_model.py ItemKNN BPR ContentBased python tune_mixed_hybrid.py python run_mixed_hybrid.py python -m pytest tests