'Posterior probabilities of classification
This function returns posterior probabilities of classification
according to each class on an array of test vectors X.
Parameters
X : array-like, shape (n_samples, n_features)
The samples.
Returns
C : array, shape (n_samples, n_classes)
The predicted probas. Can be exact zeros.'

def predict_proba(self, X):

    n_classes = len(self.classes_)
    proba = np.zeros((X.shape[0], n_classes))
    (df, idx_pos_class) = self._preproc(X)
    for (k, this_df, calibrator) in zip(idx_pos_class, df.T, self.calibrators_):
        if (n_classes == 2):
            k += 1
        proba[:, k] = calibrator.predict(this_df)
    if (n_classes == 2):
        proba[:, 0] = (1.0 - proba[:, 1])
    else:
        proba /= np.sum(proba, axis=1)[:, np.newaxis]
    proba[np.isnan(proba)] = (1.0 / n_classes)
    proba[((1.0 < proba) & (proba <= (1.0 + 1e-05)))] = 1.0
    return proba
