Commits

Aleš Erjavec  committed ec47c1a

Improved exception checking for learner pre-test.

  • Participants
  • Parent commits 3ab2a33

Comments (0)

Files changed (1)

File Orange/OrangeWidgets/Evaluate/OWTestLearners.py

                 learner = self.preprocessor.wrapLearner(learner)
             try:
                 predictor = learner(new)
+            except Exception, ex:
+                learner_exceptions.append((l, ex))
+                l.scores = []
+                l.results = None
+            else:
                 if (multilabel and isinstance(learner, Orange.multilabel.MultiLabelLearner)) or predictor(new[0]).varType == new.domain.classVar.varType:
                     learners.append(learner)
                     used_ids.append(l.id)
                     l.scores = []
                     l.results = None
 
-            except Exception, ex:
-                learner_exceptions.append((l, ex))
-                l.scores = []
-                l.results = None
-
         if learner_exceptions:
             text = "\n".join("Learner %s ends with exception: %s" % (l.name, str(ex)) \
                              for l, ex in learner_exceptions)