4046c198f9a4a9d209926aa8cabbda0d962f7e7a,pyemma/_base/model.py,Model,__my_setstate__,#Model#Any#,43

Before Change


    def __my_setstate__(self, state):
        if state:
            params = {k: state[k] for k in self._get_model_param_names() if k in state}
            if params:
                for k in params:
                    del state[k]
                self.set_model_params(**params)

    @classmethod
    def _get_model_param_names(cls):
        rGet parameter names for the model
        // fetch model parameters

After Change



    def __my_setstate__(self, state):
        if state:
            for c in filter(lambda c: hasattr(c, "_get_model_param_names"), self.__class__.__mro__):
                // TODO: actually we would desire to pop from state, but this can"t be done because of ThermoMSM (would pop pi twice)
                params_for_c = { k: state.get(k, None) for k in c._get_model_param_names()}
                c.set_model_params(self, **params_for_c)

    @classmethod
    def _get_model_param_names(cls):
        rGet parameter names for the model
        // fetch model parameters
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: markovmodel/PyEMMA
Commit Name: 4046c198f9a4a9d209926aa8cabbda0d962f7e7a
Time: 2018-01-09
Author: m.scherer@fu-berlin.de
File Name: pyemma/_base/model.py
Class Name: Model
Method Name: __my_setstate__


Project Name: caserec/CaseRecommender
Commit Name: 7dee2f4ba62ccc13ce545ad2aa38294b3d23f3f2
Time: 2015-11-25
Author: fortes.arthur@gmail.com
File Name: recommenders/rating_prediction/itemknn.py
Class Name: ItemKNN
Method Name: calculate_similarity


Project Name: markovmodel/PyEMMA
Commit Name: d58f782c5ed1e6e21035ec23012b54720f293503
Time: 2017-12-19
Author: m.scherer@fu-berlin.de
File Name: pyemma/_base/estimator.py
Class Name: Estimator
Method Name: __my_setstate__