Changeset 10847:0404e6b125e1 in orange


Ignore:
Timestamp:
04/24/12 12:25:50 (2 years ago)
Author:
Lan Zagar <lan.zagar@…>
Branch:
default
Message:

Fix pickling of multitarget learners and classifiers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Orange/multitarget/__init__.py

    r10420 r10847  
    6565    def __init__(self, learner, **kwargs): 
    6666        """ 
    67  
    6867        :param learner: Base learner used to construct independent 
    6968                        models for each class. 
    70                          
    7169        """ 
    72  
    7370        self.learner = learner 
    7471        self.__dict__.update(kwargs) 
     
    9693        return MultitargetClassifier(classifiers=classifiers, domains=domains) 
    9794         
     95    def __reduce__(self): 
     96        return type(self), (self.learner,), dict(self.__dict__) 
     97 
    9898 
    9999class MultitargetClassifier(Orange.classification.Classifier): 
     
    127127               else predictions 
    128128 
     129    def __reduce__(self): 
     130        return type(self), (self.classifiers, self.domains), dict(self.__dict__) 
     131 
Note: See TracChangeset for help on using the changeset viewer.