diff --git a/src/bayesvalidrox/surrogate_models/surrogate_models.py b/src/bayesvalidrox/surrogate_models/surrogate_models.py index f478bbd5e80921cfbee3b464bca3a95c609305a0..722221d74aabad5a06f94925bdd790ea115e3d01 100644 --- a/src/bayesvalidrox/surrogate_models/surrogate_models.py +++ b/src/bayesvalidrox/surrogate_models/surrogate_models.py @@ -701,18 +701,18 @@ 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_ + # 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