1
0
mirror of https://git.tt-rss.org/git/tt-rss.git synced 2025-12-16 01:45:56 +00:00

apparently classifier may return NaN

This commit is contained in:
Andrew Dolgov
2015-06-18 18:53:52 +03:00
parent 168e32b946
commit bc0e565a77

View File

@@ -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;
}