Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions sbi/diagnostics/lc2st.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ def eval_lc2st(
# probability of being in P (class 0)
proba = clf.predict_proba(joint_p)[:, 0] # type: ignore
# mean squared error between proba and dirac at 0.5
score = float(((proba - [0.5] * len(proba)) ** 2).mean())
score = float(np.mean((proba - 0.5) ** 2))

if return_proba:
return proba, score
Expand Down Expand Up @@ -864,5 +864,5 @@ def fit(self, X, y):
self.trained_clfs.append(clf)

def predict_proba(self, X):
probas = [clf.predict_proba(X) for clf in self.trained_clfs]
probas = np.array([clf.predict_proba(X) for clf in self.trained_clfs])
return np.mean(probas, axis=0)