def is_converge(self):
        """Return True if the convergence criteria is matched.

        """

        if len(self.list_cv_values) < self.wind:
            return
        start_idx = -self.wind
        mid_idx = -(self.wind // 2)
        old_mean = np.array(self.list_cv_values[start_idx:mid_idx]).mean()
        current_mean = np.array(self.list_cv_values[mid_idx:]).mean()
        normalize_residual_metrics = (np.abs(old_mean - current_mean) /
                                      np.abs(old_mean))
        self.converge_flag = normalize_residual_metrics < self.eps
def is_converge ( self ) : if len ( self . list_cv_values ) < self . wind : return start_idx = - self . wind mid_idx = - ( self . wind // 2 ) old_mean = np . array ( self . list_cv_values [ start_idx : mid_idx ] ) . mean ( ) current_mean = np . array ( self . list_cv_values [ mid_idx : ] ) . mean ( ) normalize_residual_metrics = ( np . abs ( old_mean - current_mean ) / np . abs ( old_mean ) ) self . converge_flag = normalize_residual_metrics < self . eps
Return True if the convergence criteria is matched.