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

Don't assume order and length is the same between observed and predicted features #3250

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

eonofrey
Copy link
Contributor

Summary:
Combining diffs D68274239 & D68294872:

1 - D68274239 - [analysis] Don't assume order is the same in observed and predicted features

This is causing only 3 of 14 arms to show on an experiment. We're still assuming that within an observation the order of the metric names matches the order of the corresponding data.

2 - D68294872 - [analysis] Don't assume observed and predicted metrics are the same length

Comment from here:

In N6432597 I encounter a StopIteration error when rebased on D68274239. I believe this is because predicted.metric_names is quite a bit longer than observed.data.metric_names and so there's a chance that

predicted_i = next(
            i
            for i in range(len(observed.data.metric_names))
            if predicted.metric_names[i] == metric_name
        )

never finds the metric it needs and throws the StopIteration error.

Differential Revision: D68336952

…ted features

Summary:
Combining diffs D68274239 & D68294872:

1 - **D68274239 - [analysis] Don't assume order is the same in observed and predicted features**

This is causing only 3 of 14 arms to show on an experiment.  We're still assuming that within an observation the order of the metric names matches the order of the corresponding data.

2 - **D68294872 - [analysis] Don't assume observed and predicted metrics are the same length**

Comment from  [here](https://www.internalfb.com/diff/D68274239?dst_version_fbid=9435339503152040&transaction_fbid=1415387593232440):

In N6432597 I encounter a `StopIteration` error when rebased on D68274239. I believe this is because `predicted.metric_names` is quite a bit longer than `observed.data.metric_names` and so there's a chance that

```
predicted_i = next(
            i
            for i in range(len(observed.data.metric_names))
            if predicted.metric_names[i] == metric_name
        )
```

never finds the metric it needs and throws the `StopIteration` error.

Differential Revision: D68336952
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jan 17, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D68336952

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.88%. Comparing base (81fba5c) to head (7a1c2f0).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3250   +/-   ##
=======================================
  Coverage   95.88%   95.88%           
=======================================
  Files         513      513           
  Lines       51689    51688    -1     
=======================================
  Hits        49562    49562           
+ Misses       2127     2126    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants