Changeset 10751:91e1dac1b42f in orange


Ignore:
Timestamp:
04/04/12 17:08:32 (2 years ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/classification/svm/__init__.py

    r10695 r10751  
    284284        assert(type(wrapped) in [_SVMClassifier, _SVMClassifierSparse]) 
    285285         
    286         if self.svm_type in [SVMLearner.C_SVC, SVMLearner.Nu_SVC]: 
    287             # Reorder the support vectors 
     286        if self.svm_type in [SVMLearner.C_SVC, SVMLearner.Nu_SVC] \ 
     287                and len(wrapped.support_vectors) > 0: 
     288            # Reorder the support vectors of the binary classifiers 
    288289            label_map = self._get_libsvm_labels_map() 
    289290            start = 0 
Note: See TracChangeset for help on using the changeset viewer.