Skip to content

[PAY-3249] Implement pnagD trending strategy #9273

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

Merged
merged 3 commits into from
Jul 30, 2024
Merged

Conversation

raymondjacobson
Copy link
Member

@raymondjacobson raymondjacobson commented Jul 25, 2024

Description

Review commit by commit pls!

The main change of this PR is very small, just some other dead code cleanup along the way.

k is defined as our coefficient of decay. Our algo is finalScore = score ^ (1 - k / time_period)
this can be seen as decaying the final score from score to 1 based on what %age of the time period (e.g. trending this week) we have covered.

in existing trending k is defined as k = now - created_at
I update the calculation here to be

k = new - max(created_at, release_date if release_date < now else created_at)

basically, if release date is in the future, use created_at, and if release date is in the past, use max(created_at, release_date)

here's the diff
image

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Provide repro instructions & any configuration.

We will be able to soak this on stage & prod before switching the default strategy over

Copy link

changeset-bot bot commented Jul 25, 2024

⚠️ No Changeset found

Latest commit: 576d4fa

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

wv = parse(v)
if wv > K:
wv = w
k = (K - max(w, wv)).days
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is really the only important change!

CASE
WHEN tp.owner_follower_count < :y
THEN 0
WHEN EXTRACT(DAYS from now() - aip.created_at) > :week
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't these also need to change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nvm think I'm misreading this on mobile

@raymondjacobson
Copy link
Member Author

looking into test failure

@raymondjacobson raymondjacobson merged commit bcd8e13 into main Jul 30, 2024
12 checks passed
@raymondjacobson raymondjacobson deleted the rj-pay-3249 branch July 30, 2024 00:22
audius-infra pushed a commit that referenced this pull request Jul 30, 2024
[df1c126] Longer deadline for fixing files (#9297) Steve Perkins
[f713455] [PAY-3236][PAY-3242][PAY-3259] Fix play button in tracks table (#9288) Saliou Diallo
[bcd8e13] [PAY-3249] Implement pnagD trending strategy (#9273) Raymond Jacobson
[f423f36] Pin Rust version to 1.79.0 (#9290) Marcus Pasell
[2065768] Resume cleanup mode (#9285) Steve Perkins
schottra added a commit that referenced this pull request Jul 30, 2024
* origin/main: (69 commits)
  Update dn models (#9291)
  [PAY-3260] Use 'Today' for matching release dates (#9292)
  [PAY-3258] BoxedTextField can error before form submission (#9305)
  [PAY-3248][PAY-3256][PAY-3234] Fix misc android issues (#9307)
  Premium extras updates (#9306)
  Silence request logs for python es client (#9301)
  [PAY-3263] add playlists & albums release date if null (#9304)
  Small FilterButton hover style tweak (#9303)
  [QA-1448] Fix user badge spacing (#9302)
  [C-4868] BPM validation (#9295)
  [C-4854] Add Premium Extras label (#9294)
  [PAY-3261] Update remix settings copy (#9299)
  Audius Protocol v0.6.158
  Longer deadline for fixing files (#9297)
  [PAY-3236][PAY-3242][PAY-3259] Fix play button in tracks table (#9288)
  [PAY-3240] Prevent wrong users from seeing /edit pages (#9298)
  PAY-3233 Disable reset on select field for AM/PM (#9296)
  [PAY-3249] Implement pnagD trending strategy (#9273)
  [PAY-3257] Default prices for premium albums/tracks (#9293)
  Pin Rust version to 1.79.0 (#9290)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants