Skip to content

Commit

Permalink
Sonarcloud bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
dimtsap committed Nov 20, 2023
1 parent a7f6dca commit b718315
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,10 @@ def predict(self, points, return_std: bool = False, hyperparameters: list = None
if hyperparameters is not None:
# This is used for MLE constraints, if constraints call 'predict' method.
self.kernel.kernel_parameter = kernelparameters[:-1]
sigma = kernelparameters[-1]
if kernelparameters is not None:
sigma = kernelparameters[-1]
else:
raise ValueError('kernelparameters is None')
K = sigma ** 2 * self.kernel.calculate_kernel_matrix(x=s_, s=s_) + \
np.eye(self.samples.shape[0]) * (noise_std ** 2)
cc = np.linalg.cholesky(K + 1e-10 * np.eye(self.samples.shape[0]))
Expand Down

0 comments on commit b718315

Please sign in to comment.