From 670395c6725bd6937e3460ee42bfabdb66b64423 Mon Sep 17 00:00:00 2001 From: Milo Date: Sat, 6 Apr 2019 17:47:33 +0200 Subject: [PATCH] better weights --- server/nightr/strategies/miloStrats.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/nightr/strategies/miloStrats.py b/server/nightr/strategies/miloStrats.py index 3b08314..593c981 100644 --- a/server/nightr/strategies/miloStrats.py +++ b/server/nightr/strategies/miloStrats.py @@ -57,7 +57,10 @@ def tv2newsStrat(context : Context) -> Prediction: avg_delta += d avg_timestamp = avg_delta // len(delta_times) // 60 p = Prediction() - p.weight = 0.7 + if avg_timestamp < 0: + p.weight = 0.0 + else: + p.weight = 0.7 p.probability = 1.0 if avg_timestamp > 50 else 0.0 p.reasons.append('There were ' + ('few' if avg_timestamp > 50 else 'many') + ' recent articles on TV2 News') return p