From 9158ed3ba2a5aecaf012690f48593ee410af01bc Mon Sep 17 00:00:00 2001 From: Jan-Henrik Bruhn Date: Fri, 6 Mar 2026 17:11:43 +0100 Subject: [PATCH] fix: change exponential rating for distance to be more agressive --- README.md | 4 ++-- worker/src/jobs/compute-scores.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4f2d65b..c81ee81 100644 --- a/README.md +++ b/README.md @@ -138,10 +138,10 @@ All scores are precomputed at ingest time for every combination of threshold (5 Each subcategory *i* contributes a proximity score based on travel time `t` and threshold `T` (both in seconds) using exponential decay: ``` -score(t, T) = exp(−3 × t / T) +score(t, T) = exp(−6 × t / T) ``` -At t = 0 the score is 1.0. At the threshold it is exp(−3) ≈ 0.05 — a POI reachable in exactly the threshold time barely contributes. Close proximity dominates: a third of the threshold away scores ~0.37, halfway scores ~0.22. This ensures that genuinely nearby POIs are rated much more highly than merely reachable ones. +At t = 0 the score is 1.0. At the threshold it is exp(−6) ≈ 0.002 — essentially zero. Close proximity strongly dominates: a sixth of the threshold away scores ~0.37, a third scores ~0.14. This ensures that only genuinely nearby POIs contribute meaningfully to the score. The category score aggregates across subcategories **and** across multiple nearby POIs of the same subcategory via a **complement product** weighted by profile-specific importance weights `w_i ∈ [0, 1]`: diff --git a/worker/src/jobs/compute-scores.ts b/worker/src/jobs/compute-scores.ts index 355084e..02a1187 100644 --- a/worker/src/jobs/compute-scores.ts +++ b/worker/src/jobs/compute-scores.ts @@ -248,7 +248,7 @@ export async function handleComputeScores( 1.0 - COALESCE(pw.weight, ${DEFAULT_SUBCATEGORY_WEIGHT}::float8) * CASE WHEN s.travel_time_s IS NULL THEN 0.0 - ELSE EXP(-3.0 * s.travel_time_s / (t.threshold_min * 60.0)) + ELSE EXP(-6.0 * s.travel_time_s / (t.threshold_min * 60.0)) END, 1e-10 ))