From 68bfdebcbdb4e833a5d8f3cb82c84087fec8e630 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 6 Sep 2025 16:24:18 +0800 Subject: [PATCH] :alembic: Testing the new ranking algo --- DysonNetwork.Sphere/Activity/ActivityService.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DysonNetwork.Sphere/Activity/ActivityService.cs b/DysonNetwork.Sphere/Activity/ActivityService.cs index a27b0c1..2e6a76b 100644 --- a/DysonNetwork.Sphere/Activity/ActivityService.cs +++ b/DysonNetwork.Sphere/Activity/ActivityService.cs @@ -25,7 +25,9 @@ public class ActivityService( // Add 1 to score to prevent negative results for posts with more downvotes than upvotes // Time dominates ranking, performance adjusts within similar timeframes. var performanceWeight = Math.Log(performanceScore + 5); // smooth adjustment, median ~4-5 - return performanceWeight / Math.Pow(timeScore + 1.5, 1.5); + // Normalize time influence since average post interval ~60 minutes + var normalizedTime = timeScore / 60.0; + return performanceWeight / Math.Pow(normalizedTime + 1.0, 1.2); } public async Task> GetActivitiesForAnyone(