def predict_proba(self, X):
Phi = metrics.pairwise.rbf_kernel(X, self.kernel_pos, self.gamma)<EOL>N = X.shape[<NUM_LIT:0>]<EOL>predictions = np.zeros((N, self.n_classes+<NUM_LIT:1>))<EOL>for i in range(N):<EOL><INDENT>post = np.zeros(self.n_classes)<EOL>for c in range(self.n_classes):<EOL><INDENT>post[c] = max(<NUM_LIT:0>,<EOL>np.dot(self.theta[self.classes[c]].T, Phi[i, :]))<EOL>post[c] = min(post[c], <NUM_LIT:1.>)<EOL><DEDENT>predictions[i, :-<NUM_LIT:1>] = post<EOL>predictions[i, -<NUM_LIT:1>] = max(<NUM_LIT:0>, <NUM_LIT:1>-sum(post))<EOL><DEDENT>return predictions<EOL>
Calculate posterior probabilities of test data.

Parameters
----------
X : array
    Test data, of dimension N times d (rows are examples, columns
    are data dimensions)

Returns:
-------
y_prob : array
    An array of dimension N times n_inlier_classes+1, containing
    the probabilities of each row of X being one of the inlier
    classes, or the outlier class (last column).