aboutsummaryrefslogtreecommitdiff
path: root/core/scoring.go
diff options
context:
space:
mode:
authorSam Scholten2026-08-30 12:50:24 +1000
committerSam Scholten2026-08-30 12:52:39 +1000
commit96ab2fcb2ff442698465389d75390afa91629165 (patch)
treeb36ef45dccaa791b0fce4dcad99d564635663c10 /core/scoring.go
downloadfluxrec-96ab2fcb2ff442698465389d75390afa91629165.tar.gz
fluxrec-96ab2fcb2ff442698465389d75390afa91629165.zip
fluxrec: personal Miniflux article recommender
Diffstat (limited to 'core/scoring.go')
-rw-r--r--core/scoring.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/scoring.go b/core/scoring.go
new file mode 100644
index 0000000..66b3a3b
--- /dev/null
+++ b/core/scoring.go
@@ -0,0 +1,16 @@
+// Vendored from scholscan/core/scoring.go (rev 7c1a5ef, 2026-08-28).
+// Owned here; no upstream sync.
+// Score conversion utilities.
+//
+// ScoreToScale: Maps probability (0-1) to user-friendly 1-10 scale.
+// Why: Users understand "8/10" better than "0.82 probability".
+package core
+
+import "math"
+
+// ScoreToScale turns probability into 1-10 display score
+func ScoreToScale(rawScore, threshold float64) int {
+ k := 10.0
+ adjustedScore := 1.0 / (1.0 + math.Exp(-k*(rawScore-threshold)))
+ return int(math.Round(1.0 + (adjustedScore * 9.0)))
+}