Skip to content
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

Merged
merged 5 commits into from
Nov 5, 2024

Conversation

fealho
Copy link
Member

@fealho fealho commented Oct 28, 2024

CU-86b2evvby, Resolve #640.

@sdv-team
Copy link
Contributor

@fealho fealho force-pushed the issue-640-interow branch 6 times, most recently from 0aaab75 to cc4fb91 Compare October 29, 2024 17:42
@fealho fealho force-pushed the issue-640-interow branch from cc4fb91 to 97a28e1 Compare October 29, 2024 17:56
@fealho fealho marked this pull request as ready for review October 29, 2024 18:02
@fealho fealho requested a review from a team as a code owner October 29, 2024 18:02
@fealho fealho requested review from frances-h, R-Palazzo and amontanez24 and removed request for a team October 29, 2024 18:02
differences = []
for key in keys.unique():
group_values = values[keys == key].to_numpy()
if len(group_values) > n_rows_diff:
Copy link
Member Author

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.

Copy link
Contributor

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?

Copy link
Contributor

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?

@fealho fealho changed the base branch from main to feature-branch-timeseries-metrics October 30, 2024 16:48
differences = []
for key in keys.unique():
group_values = values[keys == key].to_numpy()
if len(group_values) > n_rows_diff:
Copy link
Contributor

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?

sdmetrics/timeseries/inter_row.py Outdated Show resolved Hide resolved
tests/unit/timeseries/test_inter_row.py Outdated Show resolved Hide resolved
Comment on lines +62 to +63
except ValueError as e:
if str(e) == 'Data passed to ks_2samp must not be empty':
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Contributor

@frances-h frances-h left a 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

@fealho fealho merged commit 884d04e into feature-branch-timeseries-metrics Nov 5, 2024
47 checks passed
@fealho fealho deleted the issue-640-interow branch November 5, 2024 02:51
fealho added a commit that referenced this pull request Nov 14, 2024
fealho added a commit that referenced this pull request Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add metric for inter-row MSAS
5 participants