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

Closed
wants to merge 1 commit into 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

@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-commenter commented Jan 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.04%. Comparing base (6ae638c) to head (2bfef3e).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3250   +/-   ##
=======================================
  Coverage   96.04%   96.04%           
=======================================
  Files         518      518           
  Lines       52162    52161    -1     
=======================================
  Hits        50098    50098           
+ Misses       2064     2063    -1     

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

eonofrey added a commit to eonofrey/Ax that referenced this pull request Jan 29, 2025
…ted features (facebook#3250)

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.

Reviewed By: danielcohenlive

Differential Revision: D68336952
@facebook-github-bot
Copy link
Contributor

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

1 similar comment
@facebook-github-bot
Copy link
Contributor

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

…ted features (facebook#3250)

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.

Reviewed By: danielcohenlive

Differential Revision: D68336952
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in a4c8fe5.

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 Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants