Skip to content

Commit

Permalink
TST: Check optimzer for coef_list, not model
Browse files Browse the repository at this point in the history
The legacy ensembling code in SINDy.fit attached the optimizer's coef_list
attribute to model.  However, this meant that coef_list was an unreliable
attribute.  Leaving it just on the EnsembleOptimizer, and testing for it there,
feels like an acceptable solution.
  • Loading branch information
Jacob-Stevens-Haas committed Jun 30, 2023
1 parent 0636b0d commit e8fd274
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/test_feature_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,12 +683,12 @@ def pde_library_helper(library, u, coef_first_dim):
opt = EnsembleOptimizer(opt=base_opt, bagging=True, n_models=10, n_subset=50)
model = SINDy(optimizer=opt, feature_library=library)
model.fit(u)
assert np.shape(model.coef_list) == (10, coef_first_dim, n_features)
assert np.shape(opt.coef_list) == (10, coef_first_dim, n_features)

opt = EnsembleOptimizer(opt=base_opt, library_ensemble=True, n_models=10)
model = SINDy(optimizer=opt, feature_library=library)
model.fit(u)
assert np.shape(model.coef_list) == (10, coef_first_dim, n_features)
assert np.shape(opt.coef_list) == (10, coef_first_dim, n_features)


def test_1D_pdes(data_1d_random_pde):
Expand Down

0 comments on commit e8fd274

Please sign in to comment.