Post Score Algorithm

This note documents a weighted formula for ranking trending posts. It then runs the numbers once so the weights are easier to reason about. The formula combines a category score, a poster score, an engagement score, an admin boost and a reward or penalty term. Engagement adds up votes, down votes, comments and views. The reward term uses a logistic curve over average view time percentage, so a video around the threshold lands near zero. A glossary defines every symbol. The worked example fixes the weights and inputs, computes engagement and reward first, then applies user and follower preference to reach a final score of about 343.47.

Table of Contents

Resources

General Formula

FS=(w5⋅CS+w6⋅PS+ES+(AB⋅w7)+RP)⋅(UP+FP)FS=(w_5 \cdot CS+w_6 \cdot PS+ES+(AB \cdot w_7)+RP)\cdot(UP+FP) ES=w1⋅UV+w2⋅DV+w3⋅TC+w4⋅TVES=w_1 \cdot UV+w_2 \cdot DV+w_3 \cdot TC+w_4 \cdot TV RP=w11⋅(11+e−k⋅(AVTP−x0)−0.5)RP=w_{11}\cdot\left(\frac{1}{1+e^{-k \cdot (AVTP-x_0)}}-0.5\right)

Variable Definitions

  • FS: Final Score of the post
  • w_5, w_6: weights for Category Score and Poster Score
  • CS: Category Score of the post
  • PS: Poster Score (boosts posts from specific authors)
  • ES: Engagement Score
  • w_1..w_4: weights for UV/DV/TC/TV
  • UV: Up Votes
  • DV: Down Votes
  • TC: Total Comments
  • TV: Total Views
  • AB: Admin Boost (1 if boosted, 0 otherwise)
  • w_7: weight for the admin boost
  • UP: User Preference for the category
  • FP: Follower Preference (1 if the user follows the poster, 0 otherwise)
  • RP: Reward/Penalty score (for example, for videos)
  • w_{11}: weight for RP
  • k: steepness
  • AVTP: Average View Time Percentage (video)
  • x_0: AVTP threshold

Worked Example

Assumptions

  • w1=2w_1 = 2, w2=1w_2 = 1, w3=0.5w_3 = 0.5, w4=0.1w_4 = 0.1
  • w5=1w_5 = 1, w6=0.8w_6 = 0.8, w7=20w_7 = 20, w11=10w_{11} = 10
  • k=10k = 10
  • x0=0.3x_0 = 0.3

Input

  • CS=0.7CS = 0.7
  • PS=0.6PS = 0.6
  • UV=50UV = 50
  • DV=20DV = 20
  • TC=10TC = 10
  • TV=500TV = 500
  • AB=1AB = 1
  • UP=0.7UP = 0.7
  • FP=1FP = 1
  • AVTP=0.8AVTP = 0.8

Computing ES

ES=2⋅50+1⋅20+0.5⋅10+0.1⋅500=175ES=2 \cdot 50+1 \cdot 20+0.5 \cdot 10+0.1 \cdot 500=175

Computing RP

RP=10⋅(11+e−10⋅(0.8−0.3)−0.5)≈4.5RP=10\cdot\left(\frac{1}{1+e^{-10 \cdot (0.8-0.3)}}-0.5\right)\approx 4.5

Computing FS

FS=(1⋅0.7+0.8⋅0.6+175+1⋅20+4.5)⋅(0.7+1)≈343.47FS=(1\cdot 0.7+0.8\cdot 0.6+175+1\cdot 20+4.5)\cdot(0.7+1)\approx 343.47

Engagement lands at 175 from the weighted votes, comments, and views. The reward is about 4.5 because view time sits above the 0.3 threshold. Admin boost adds 20 with the flag on. User preference plus follower preference then scales the sum to about 343.47.

See also: Big O Notation · Learning Resources