Ticket #1293 (new bug)

Opened 16 months ago

SVMClassifier.get_binary_classifier raises a IndexError

Reported by: ales Owned by: ales
Milestone: Component: library
Severity: minor Keywords: svm
Cc: Blocking:
Blocked By:

Description

when the training set did not have any instances for a subset of classes (reported  here)

iris = Orange.data.Table("iris")
iris_missing = Orange.data.Table(iris[50:])  # Remove all Iris-setosa instances
svm_l = Orange.classification.svm.SVMLearner()
svm_c = svm_l(iris_missing)
# This breaks
svm_c.get_binary_classifier(1, 2)

raises a

---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
<ipython-input-7-ef81f4fa151c> in <module>()
----> 1 svm_c.get_binary_classifier(1, 2)

/Users/aleserjavec/workspace/orange/Orange/classification/svm/__init__.pyc in get_binary_classifier(self, c1, c2)
    584                        (n_class - c2)
    585 
--> 586         coef = self.coef[classifier_i]
    587 
    588         coef1 = [(mult * alpha, sv_i) for alpha, sv_i in coef \

IndexError: list index out of range
Note: See TracTickets for help on using tickets.