'Pickle-protocol - set state of the estimator.
We need to rebuild the interpolation function.'

def __setstate__(self, state):

    super(IsotonicRegression, self).__setstate__(state)
    if (hasattr(self, '_necessary_X_') and hasattr(self, '_necessary_y_')):
        self._build_f(self._necessary_X_, self._necessary_y_)
