Skip to content

Commit

Permalink
Fix variance prediction (#542)
Browse files Browse the repository at this point in the history
* fix prediction for high output
  • Loading branch information
Paul-Saves authored Apr 9, 2024
1 parent 4d80c52 commit fb82f9d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions smt/surrogate_models/krg_based.py
Original file line number Diff line number Diff line change
Expand Up @@ -1667,6 +1667,8 @@ def _predict_variances(self, x: np.ndarray, is_acting=None) -> np.ndarray:
)
A = self.optimal_par["sigma2"]
B = 1.0 - (rt**2.0).sum(axis=0) + (u**2.0).sum(axis=0)
# machine precision: force to zero!
B[B<1e-12]=0
MSE = np.einsum("i,j -> ji", A, B)
# Mean Squared Error might be slightly negative depending on
# machine precision: force to zero!
Expand Down

0 comments on commit fb82f9d

Please sign in to comment.