def __setstate__(self, d):
        for name, value in d.iteritems():
            if name not in ['nfeatures', 'dtype', 'description', 'discretized',
                            'min_features', 'max_features', 'states_per_dim']:
                setattr(self, name, value)

        type(self).nfeatures = self._features.shape[0]