def fit_predict(self, X_train, y_train, X_test):
        """Return average class probabilities of posterior estimates of the
        test samples.
        Use only with MCMC!

        Parameters
        ----------
        X_train : scipy.sparse.csc_matrix, (n_samples, n_features)

        y_train : array, shape (n_samples)
                the targets have to be encodes as {-1, 1}.

        X_test : scipy.sparse.csc_matrix, (n_test_samples, n_features)

        Returns
        -------
        y_pred : array, shape (n_test_samples)
                Returns predicted class labels.

        """
        y_proba = self.fit_predict_proba(X_train, y_train, X_test)
        y_pred = np.zeros_like(y_proba, dtype=np.float64) + self.classes_[0]
        y_pred[y_proba > .5] = self.classes_[1]
        return y_pred
dataset/ETHPy150Open ibayer/fastFM/fastFM/mcmc.py/FMClassification.fit_predict/original