-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autoemulate.compare: proposed fix for issue #222 #224
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #224 +/- ##
==========================================
+ Coverage 91.14% 91.19% +0.05%
==========================================
Files 45 45
Lines 2393 2407 +14
==========================================
+ Hits 2181 2195 +14
Misses 212 212 ☔ View full report in Codecov by Sentry. |
comment re indentation Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for spotting and fixing this @MaxBalmus !
Also, would you mind adding a test for this to test_compare.py
? I think something like this should work:
# --------------- test correct hyperparameter updating ------------------
def test_param_search_updates_models(ae, Xy):
X, y = Xy
ae.setup(X, y, model_subset=["RandomForest"], param_search=True,
param_search_iters=5)
params_before = ae.models[0].get_params() # just one model, so index with 0
ae.compare()
params_after = ae.models[0].get_params()
assert params_before != params_after
def test_model_params_equal_wo_param_search(ae, Xy):
X, y = Xy
ae.setup(X, y, model_subset=["RandomForest"])
params_before = ae.models[0].get_params()
ae.compare()
params_after = ae.models[0].get_params()
assert params_before == params_after
tests can be run with pytest
: pytest tests/test_compare.py::test_param_search_updates_models
Silly question: how do I run the tests locally? |
not a silly question! Run them with
let me know if something doesn't work! |
@all-contributors please add @MaxBalmus for code, bug |
I've put up a pull request to add @MaxBalmus! 🎉 |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
params_after = ae.models[0].get_params() | ||
assert params_before != params_after | ||
|
||
def test_model_params_equal_wo_param_search(ae, Xy): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blackfmt] reported by reviewdog 🐶
def test_model_params_equal_wo_param_search(ae, Xy): | |
def test_model_params_equal_wo_param_search(ae, Xy): |
tests/test_compare.py
Outdated
params_before = ae.models[0].get_params() | ||
ae.compare() | ||
params_after = ae.models[0].get_params() | ||
assert params_before == params_after |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[blackfmt] reported by reviewdog 🐶
assert params_before == params_after | |
assert params_before == params_after |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks great!
No description provided.