diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2020-09-28 10:29:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-28 10:29:50 +0300 |
commit | b8e446b3c43b7d5b7c6e14ff7b7091b6a233e42e (patch) | |
tree | 3f3f1ee26ea68f7726e9812826ee97e713e1d42c /lib/Service | |
parent | be1baaed3c64879d989def1066110b626f8959f3 (diff) | |
parent | 37234b4f428fd03f3f18e66494c57f542f0078d9 (diff) |
Merge pull request #3655 from nextcloud/fix/classifier-no-stats-notice
Fix php notice about undinfed index in importance classifier
Diffstat (limited to 'lib/Service')
-rw-r--r-- | lib/Service/Classification/ImportanceClassifier.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Service/Classification/ImportanceClassifier.php b/lib/Service/Classification/ImportanceClassifier.php index 5cbc37173..514e6c5b1 100644 --- a/lib/Service/Classification/ImportanceClassifier.php +++ b/lib/Service/Classification/ImportanceClassifier.php @@ -361,9 +361,9 @@ class ImportanceClassifier { $predictedValidationLabel, array_column($validationSet, 'label') ); - $recallImportant = $report['classes'][self::LABEL_IMPORTANT]['recall']; - $precisionImportant = $report['classes'][self::LABEL_IMPORTANT]['precision']; - $f1ScoreImportant = $report['classes'][self::LABEL_IMPORTANT]['f1_score']; + $recallImportant = $report['classes'][self::LABEL_IMPORTANT]['recall'] ?? 0; + $precisionImportant = $report['classes'][self::LABEL_IMPORTANT]['precision'] ?? 0; + $f1ScoreImportant = $report['classes'][self::LABEL_IMPORTANT]['f1_score'] ?? 0; /** * What we care most is the percentage of messages classified as important in relation to the truly important messages |