From: Andrew Dolgov Date: Thu, 18 Jun 2015 15:53:52 +0000 (+0300) Subject: apparently classifier may return NaN X-Git-Tag: 16.3~276 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=bc0e565a7779152de054509ee52d9a34d077ca9f;p=tt-rss.git apparently classifier may return NaN --- diff --git a/plugins/af_sort_bayes/init.php b/plugins/af_sort_bayes/init.php index 2293ea49..51867f08 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; }