diff --git a/src/bayesvalidrox/surrogate_models/surrogate_models.py b/src/bayesvalidrox/surrogate_models/surrogate_models.py index 722221d74aabad5a06f94925bdd790ea115e3d01..5194a95b4c3b519ca02977a44c85ab2e0f04af2a 100644 --- a/src/bayesvalidrox/surrogate_models/surrogate_models.py +++ b/src/bayesvalidrox/surrogate_models/surrogate_models.py @@ -701,22 +701,11 @@ class MetaModel(): # The first column must be kept (For mean calculations) nnz_idx = np.nonzero(clf_poly.coef_)[0] - # if len(nnz_idx) == 0 or nnz_idx[0] != 0: - # nnz_idx = np.insert(np.nonzero(clf_poly.coef_)[0], 0, 0) - # # Remove the zero entries for Bases and PSI if need be - # if sparsity: - # sparse_basis_indices = basis_indices.toarray()[nnz_idx] - # else: - # sparse_basis_indices = basis_indices[nnz_idx] - # sparse_X = X[:, nnz_idx] - - # # Store the coefficients of the regression model - # clf_poly.fit(sparse_X, y) - # coeffs = clf_poly.coef_ - # This is for the case where all outputs are zero, thereby # all coefficients are zero - nnz_idx = np.nonzero(clf_poly.coef_)[0] + if len(nnz_idx) == 0 or nnz_idx[0] != 0: + nnz_idx = np.insert(np.nonzero(clf_poly.coef_)[0], 0, 0) + if sparsity: sparse_basis_indices = basis_indices.toarray()[nnz_idx] else: