Skip to content

feat(feed): genre affinity scoring for the for-you feed#951

Merged
dylanjeffers merged 1 commit into
mainfrom
feed-for-you-genre-affinity
Jun 12, 2026
Merged

feat(feed): genre affinity scoring for the for-you feed#951
dylanjeffers merged 1 commit into
mainfrom
feed-for-you-genre-affinity

Conversation

@dylanjeffers

Copy link
Copy Markdown
Contributor

Item 3 of the for-you feed improvement queue (follows #949 content-type weighting and #950 repeat suppression).

What

Adds a genre_affinity multiplier to final_score, built from the genre mix of the viewer's recent listening:

  • New `my_genre_affinity` CTE: joins the viewer's most recent plays (bounded to the last 1000, same pattern as the other play sub-selects) to `tracks.genre` and computes each genre's share of plays.
  • Multiplier: `0.85 + 0.45 * min(genre_share / 0.30, 1)` — a genre at >=30% of recent listening gets the full 1.30x, genres the viewer never plays get 0.85x.
  • Neutral 1.00x for playlists (no single genre), genre-less tracks, and cold-start users with no play history (no penalty when we know nothing).

Tests

  • `TestV1FeedForYou_GenreAffinityBoostsFavoredGenre`: an all-Electronic listener sees the Electronic sibling outrank the naturally-stronger Rock sibling, while the Rock track stays in the feed.
  • `TestV1FeedForYou_GenreAffinityNeutralOnColdStart`: no play history → natural ranking unchanged.

`go build ./...` and the full `go test ./...` suite pass locally.

🤖 Opened by the automated feed-algorithm-improvement-loop.

Add a genre_affinity multiplier to the for-you feed final_score, built
from the genre mix of the viewer's most recent plays (bounded scan,
last 1000): a genre at >=30% of recent listening gets the full 1.30x,
unfamiliar genres get 0.85x, and playlists / genre-less tracks /
cold-start users stay neutral at 1.00x.
@dylanjeffers dylanjeffers merged commit 40ebfe1 into main Jun 12, 2026
4 checks passed
@dylanjeffers dylanjeffers deleted the feed-for-you-genre-affinity branch June 12, 2026 08:19
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