Commits

Aleš Erjavec committed 91e1dac

Fixed an error when the wrapped model has no support vectors.

Comments (0)

Files changed (1)

Orange/classification/svm/__init__.py

         
         assert(type(wrapped) in [_SVMClassifier, _SVMClassifierSparse])
         
-        if self.svm_type in [SVMLearner.C_SVC, SVMLearner.Nu_SVC]:
-            # Reorder the support vectors
+        if self.svm_type in [SVMLearner.C_SVC, SVMLearner.Nu_SVC] \
+                and len(wrapped.support_vectors) > 0:
+            # Reorder the support vectors of the binary classifiers
             label_map = self._get_libsvm_labels_map()
             start = 0
             support_vectors = []