Commits

Aleš Erjavec  committed 94e1207

Fixed 'above_threshold' test condition.

It now tests True for scores equal to threshold (as documented).

  • Participants
  • Parent commits 56cf220

Comments (0)

Files changed (2)

File Orange/feature/selection.py

     """Return features (without scores) with scores above or
     equal to a specified threshold.
 
-    :param scores: a list such as one returned by
-      :obj:`~Orange.feature.scoring.score_all`
-    :type scores: list
-    :param threshold: threshold for selection
-    :type threshold: float
+    :param list scores:
+        A list such as one returned by :func:`.score_all`
+    :param float threshold: Threshold for selection.
     :rtype: :obj:`list`
 
     """
-    return [x[0] for x in scores if x[1] > threshold]
+    return [f for f, score in scores if score >= threshold]
 
 
 attsAboveThreshold = above_threshold

File Orange/testing/unit/tests/test_feature_selection.py

         
     def test_above_threashold(self):
         threshold = self.scores[len(self.scores) / 2][1]
-        above = [item[0] for item in self.scores if item[1] > threshold]
+        above = [item[0] for item in self.scores if item[1] >= threshold]
         
         self.assertEqual(above, 
                          selection.above_threshold(self.scores, threshold)