diff --git a/src/bayesvalidrox/surrogate_models/bayes_linear.py b/src/bayesvalidrox/surrogate_models/bayes_linear.py index a8aeb54d0189dafbe445900fa2e8e10df78a0125..8fee8bb429cfbc27c9b57156bf09fc6db46e2414 100644 --- a/src/bayesvalidrox/surrogate_models/bayes_linear.py +++ b/src/bayesvalidrox/surrogate_models/bayes_linear.py @@ -266,7 +266,7 @@ class EBLinearRegression(BayesianLinearRegression): converged = self._check_convergence(mu, mu_old) if self.verbose: print(f"Iteration {i} completed") - if converged is True: + if converged == True: print(f"Algorithm converged after {i} iterations") if converged or i == self.n_iter - 1: break @@ -470,9 +470,9 @@ class VBLinearRegression(BayesianLinearRegression): # check convergence converged = self._check_convergence(mu, mu_old) - if self.verbose is True: + if self.verbose == True: print(f"Iteration {i} is completed") - if converged is True: + if converged == True: print(f"Algorithm converged after {i} iterations") # terminate if convergence or maximum number of iterations are achieved diff --git a/src/bayesvalidrox/surrogate_models/reg_fast_ard.py b/src/bayesvalidrox/surrogate_models/reg_fast_ard.py index 9117b5bee61f3bc457454d50630039653006a565..2a8aa1163a344b93291f1e743f541b51bb06b8bd 100755 --- a/src/bayesvalidrox/surrogate_models/reg_fast_ard.py +++ b/src/bayesvalidrox/surrogate_models/reg_fast_ard.py @@ -24,8 +24,8 @@ def update_precisions(Q, S, q, s, A, active, tol, n_samples, clf_bias): # identify features that can be added , recomputed and deleted in model theta = q**2 - s - add = (theta > 0) * (active is False) - recompute = (theta > 0) * (active is True) + add = (theta > 0) * (active==False) + recompute = (theta > 0) * (active==True) delete = ~(add + recompute) # compute sparsity & quality parameters corresponding to features in @@ -66,11 +66,11 @@ def update_precisions(Q, S, q, s, A, active, tol, n_samples, clf_bias): # if not converged update precision parameter of weights and return if theta[feature_index] > 0: A[feature_index] = s[feature_index]**2 / theta[feature_index] - if active[feature_index] is False: + if active[feature_index]==False: active[feature_index] = True else: # at least two active features - if active[feature_index] is True and np.sum(active) >= 2: + if active[feature_index]==True and np.sum(active) >= 2: # do not remove bias term in classification # (in regression it is factored in through centering) if not (feature_index == 0 and clf_bias):