Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[WIP] Add example for recommender system with ranking metrics #31531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

shivamchhuneja
Copy link
Contributor

This WIP PR introduces a new educational example: plot_recommender_with_ranking_metrics.py under examples/neighbors/.

The example shows two approaches to content-based recommendation system:

  1. Cosine similarity on item-item matrix
  2. NearestNeighbors with cosine distance

It also uses top_k_accuracy_score for evaluation.

We’re splitting the example into two parts to show both the manual cosine similarity approach (for conceptual clarity) and the NearestNeighbors method (for scalable implementation).

The thinking is that this split will allow users to understand the mechanics while also learning an almost production-friendly pattern for mid sized datasets, while deeply understanding the difference between the two also on the performance level.

(too ambitious maybe? thoughts?)


✅ Plan:

  • Add example docstring and scaffold
  • Add/Create toy dataset
  • Implement cosine similarity recommendation
  • Implement NearestNeighbors recommendation
  • Evaluate both with top_k_accuracy_score
  • Light visualization (if needed)

Feedback welcome on the:

  • overall structure
  • location (examples/neighbors)
  • approach on weather it makes sense to split into two or should we just go with one method in this example

cc @adrinjalali @StefanieSenger @lorentzenchr

ps. apologies on the previous pr open (rebase issue)

Copy link

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: d9e27df. Link to the linter CI: here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant