From bc0e565a7779152de054509ee52d9a34d077ca9f Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 18 Jun 2015 18:53:52 +0300 Subject: apparently classifier may return NaN --- plugins/af_sort_bayes/init.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/af_sort_bayes/init.php b/plugins/af_sort_bayes/init.php index 2293ea490..51867f08e 100644 --- a/plugins/af_sort_bayes/init.php +++ b/plugins/af_sort_bayes/init.php @@ -315,10 +315,10 @@ class Af_Sort_Bayes extends Plugin { $prob_good = $result[$id_good]; $prob_bad = $result[$id_bad]; - if ($prob_good > 0.90) { + if (!is_nan($prob_good) && $prob_good > 0.90) { $dst_category = $id_good; $article["score_modifier"] += $this->score_modifier; - } else if ($prob_bad > 0.90) { + } else if (!is_nan($prob_bad) && $prob_bad > 0.90) { $dst_category = $id_bad; $article["score_modifier"] -= $this->score_modifier; } -- cgit v1.2.3