-
Notifications
You must be signed in to change notification settings - Fork 881
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
Fix/representation of model with DataFrame/Array parameters #1749
Conversation
… representation for pd.DataFrame and np.ndarray to avoid ambiguity when checking equality
Codecov ReportPatch coverage has no change and project coverage change:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #1749 +/- ##
==========================================
- Coverage 94.19% 94.06% -0.13%
==========================================
Files 125 125
Lines 11505 11491 -14
==========================================
- Hits 10837 10809 -28
- Misses 668 682 +14
☔ View full report in Codecov by Sentry. |
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 good, just had a minor suggestion :) 🚀
if include_default_params | ||
or ( | ||
isinstance(v, (pd.DataFrame, np.ndarray)) | ||
and np.any(v != default_model_params.get(k, None)) | ||
) | ||
or v != default_model_params.get(k, None) |
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.
I think we can use np in general
if include_default_params | |
or ( | |
isinstance(v, (pd.DataFrame, np.ndarray)) | |
and np.any(v != default_model_params.get(k, None)) | |
) | |
or v != default_model_params.get(k, None) | |
if include_default_params | |
or np.any(v != default_model_params.get(k, None)) |
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.
LGTM, thanks 🚀
…1749) * fix: added a test case when comparing the parameters for model string representation for pd.DataFrame and np.ndarray to avoid ambiguity when checking equality * fix: using the proper operator to detect inequality * fix: applying reviwer suggestion to simplify test --------- Co-authored-by: Dennis Bader <dennis.bader@gmx.ch>
Fixes #1746.
Summary
Use
np.any
when trying to comparepd.DataFrame
(holidays
ofProphet
for example) andnp.ndarray
parameters with the defaults when generating the representation string of a model in_get_model_description_string()
.Other Information
Not sure that showing the whole dataframe is the best approach, we could eventually use the
.head
? Or have a placeholder name such as "CustomDataFrame"?