def _get_oof_pred_proba(self, X, **kwargs):
    if callable(getattr(self.model, 'predict_proba_loo', None)):
        y_oof_pred_proba = self.model.predict_proba_loo()
    elif callable(getattr(self.model, 'predict_loo', None)):
        y_oof_pred_proba = self.model.predict_loo()
    else:
        raise AssertionError(f'Model class {type(self.model)} does not support out-of-fold prediction generation.')
    y_oof_pred_proba = self._convert_proba_to_unified_form(y_oof_pred_proba)
    if ((X is not None) and self._X_unused_index):
        X_unused = X.iloc[self._X_unused_index]
        y_pred_proba_new = self.predict_proba(X_unused)
        X_unused_index = set(self._X_unused_index)
        num_rows = len(X)
        X_used_index = [i for i in range(num_rows) if (i not in X_unused_index)]
        oof_pred_shape = y_oof_pred_proba.shape
        if (len(oof_pred_shape) == 1):
            y_oof_tmp = np.zeros(num_rows, dtype=np.float32)
            y_oof_tmp[X_used_index] = y_oof_pred_proba
            y_oof_tmp[self._X_unused_index] = y_pred_proba_new
        else:
            y_oof_tmp = np.zeros((num_rows, oof_pred_shape[1]), dtype=np.float32)
            y_oof_tmp[X_used_index, :] = y_oof_pred_proba
            y_oof_tmp[self._X_unused_index, :] = y_pred_proba_new
        y_oof_pred_proba = y_oof_tmp
    return y_oof_pred_proba
def _get_oof_pred_proba(self, X, **kwargs):
    if callable(getattr(self.model, 'predict_proba_loo', None)):
        y_oof_pred_proba = self.model.predict_proba_loo()
    elif callable(getattr(self.model, 'predict_loo', None)):
        y_oof_pred_proba = self.model.predict_loo()
    else:
        raise AssertionError(f'Model class {type(self.model)} does not support out-of-fold prediction generation.')
    y_oof_pred_proba = self._convert_proba_to_unified_form(y_oof_pred_proba)
    if ((X is not None) and self._X_unused_index):
        X_unused = X.iloc[self._X_unused_index]
        y_pred_proba_new = self.predict_proba(X_unused)
        X_unused_index = set(self._X_unused_index)
        num_rows = len(X)
        X_used_index = [i for i in range(num_rows) if (i not in X_unused_index)]
        oof_pred_shape = y_oof_pred_proba.shape
        if (len(oof_pred_shape) == 1):
            y_oof_tmp = np.zeros(num_rows, dtype=np.float32)
            y_oof_tmp[X_used_index] = y_oof_pred_proba
            y_oof_tmp[self._X_unused_index] = y_pred_proba_new
        else:
            y_oof_tmp = np.zeros((num_rows, oof_pred_shape[1]), dtype=np.float32)
            y_oof_tmp[X_used_index, :] = y_oof_pred_proba
            y_oof_tmp[self._X_unused_index, :] = y_pred_proba_new
        y_oof_pred_proba = y_oof_tmp
    return y_oof_pred_proba