-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add metric for inter-row MSAS #647
Conversation
0aaab75
to
cc4fb91
Compare
cc4fb91
to
97a28e1
Compare
sdmetrics/timeseries/inter_row.py
Outdated
differences = [] | ||
for key in keys.unique(): | ||
group_values = values[keys == key].to_numpy() | ||
if len(group_values) > n_rows_diff: |
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.
If n_rows_diff is larger than the sequence lengths, np.mean(diff) is np.nan. The KSComplement doesn't support np.nan values for python 3.8.
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.
Should we raise an error here?
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.
Can we add a test where n_rows_diff
is larger than a sequence?
sdmetrics/timeseries/inter_row.py
Outdated
differences = [] | ||
for key in keys.unique(): | ||
group_values = values[keys == key].to_numpy() | ||
if len(group_values) > n_rows_diff: |
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.
Should we raise an error here?
except ValueError as e: | ||
if str(e) == 'Data passed to ks_2samp must not be empty': |
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.
Should we check the inputs instead of trying to catch the error from the error message?
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.
Only old versions of scipy raise this error, newer ones support empty data.
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 for addressing
CU-86b2evvby, Resolve #640.