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

Allow more flexible definition of which trial statuses to fit. #2432

Closed

Conversation

bernardbeckerman
Copy link
Contributor

Summary:
Changes observations_from_data and observations_from_map_data signatures, replacing arg fit_abandoned: bool -> statuses_to_fit and statuses_to_fit_map_metric which are both Optional[List[TrialStatus]]. In observations_from_data, these default to None in which case {TrialStatus.COMPLETED} is used for any MapMetrics, else NON_ABANDONED_STATUSES, i.e., all trial statuses except abandoned. In observations_from_map_data, NON_ABANDONED_STATUSES are the default for all metrics.

NOTE: As of this diff, any rows of Data.df containing metric_names that don't exist on experiment will be filtered out (pointer).

Reviewed By: saitcakmak

Differential Revision: D56634321

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label May 6, 2024
@facebook-github-bot
Copy link
Contributor

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

bernardbeckerman pushed a commit to bernardbeckerman/Ax that referenced this pull request May 6, 2024
…ook#2432)

Summary:

Changes `observations_from_data` and `observations_from_map_data` signatures, replacing arg `fit_abandoned: bool` -> `statuses_to_fit` and `statuses_to_fit_map_metric` which are both `Optional[List[TrialStatus]]`. In `observations_from_data`, these default to `None` in which case `{TrialStatus.COMPLETED}` is used for any MapMetrics, else `NON_ABANDONED_STATUSES`, i.e., all trial statuses except abandoned. In `observations_from_map_data`, `NON_ABANDONED_STATUSES` are the default for all metrics.

NOTE: As of this diff, any rows of `Data.df` containing `metric_names` that don't exist on `experiment` will be filtered out ([pointer](https://www.internalfb.com/diff/D56634321?permalink=330145676765780)).

Reviewed By: saitcakmak

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

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

bernardbeckerman pushed a commit to bernardbeckerman/Ax that referenced this pull request May 6, 2024
…ook#2432)

Summary:

Changes `observations_from_data` and `observations_from_map_data` signatures, replacing arg `fit_abandoned: bool` -> `statuses_to_fit` and `statuses_to_fit_map_metric` which are both `Optional[List[TrialStatus]]`. In `observations_from_data`, these default to `None` in which case `{TrialStatus.COMPLETED}` is used for any MapMetrics, else `NON_ABANDONED_STATUSES`, i.e., all trial statuses except abandoned. In `observations_from_map_data`, `NON_ABANDONED_STATUSES` are the default for all metrics.

NOTE: As of this diff, any rows of `Data.df` containing `metric_names` that don't exist on `experiment` will be filtered out ([pointer](https://www.internalfb.com/diff/D56634321?permalink=330145676765780)).

Reviewed By: saitcakmak

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

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

@codecov-commenter
Copy link

codecov-commenter commented May 6, 2024

Codecov Report

Attention: Patch coverage is 98.87640% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 95.30%. Comparing base (3f8540e) to head (4dcfd84).

Files Patch % Lines
ax/modelbridge/base.py 88.88% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2432   +/-   ##
=======================================
  Coverage   95.30%   95.30%           
=======================================
  Files         494      494           
  Lines       47920    47990   +70     
=======================================
+ Hits        45670    45739   +69     
- Misses       2250     2251    +1     

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

bernardbeckerman pushed a commit to bernardbeckerman/Ax that referenced this pull request May 6, 2024
…ook#2432)

Summary:

Changes `observations_from_data` and `observations_from_map_data` signatures, replacing arg `fit_abandoned: bool` -> `statuses_to_fit` and `statuses_to_fit_map_metric` which are both `Optional[List[TrialStatus]]`. In `observations_from_data`, these default to `None` in which case `{TrialStatus.COMPLETED}` is used for any MapMetrics, else `NON_ABANDONED_STATUSES`, i.e., all trial statuses except abandoned. In `observations_from_map_data`, `NON_ABANDONED_STATUSES` are the default for all metrics.

NOTE: As of this diff, any rows of `Data.df` containing `metric_names` that don't exist on `experiment` will be filtered out ([pointer](https://www.internalfb.com/diff/D56634321?permalink=330145676765780)).

Reviewed By: saitcakmak

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

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

bernardbeckerman pushed a commit to bernardbeckerman/Ax that referenced this pull request May 7, 2024
…ook#2432)

Summary:

Changes `observations_from_data` and `observations_from_map_data` signatures, replacing arg `fit_abandoned: bool` -> `statuses_to_fit` and `statuses_to_fit_map_metric` which are both `Optional[List[TrialStatus]]`. In `observations_from_data`, these default to `None` in which case `{TrialStatus.COMPLETED}` is used for any MapMetrics, else `NON_ABANDONED_STATUSES`, i.e., all trial statuses except abandoned. In `observations_from_map_data`, `NON_ABANDONED_STATUSES` are the default for all metrics.

NOTE: As of this diff, any rows of `Data.df` containing `metric_names` that don't exist on `experiment` will be filtered out ([pointer](https://www.internalfb.com/diff/D56634321?permalink=330145676765780)).

Reviewed By: saitcakmak

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

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

Bernie Beckerman added 3 commits May 7, 2024 06:18
…sponding experiments (facebook#2422)

Summary:

In D56634321, observations_from_dataframe fails if there are metric_names Data.df that don't also exist on the experiment. This adjusts tests so that they avoid this issue.

Reviewed By: saitcakmak

Differential Revision: D56850033
Summary:

`Keys.PAIRWISE_PREFERENCE_QUERY` or `str(Keys.PAIRWISE_PREFERENCE_QUERY)` is commonly used when a string is expected, whereas I'm suspecting the intention is `Keys.PAIRWISE_PREFERENCE_QUERY.value`. This is causing issues in D56634321 which (for now) fails if any metrics in Data.df are not present on experiment when calling observations_from_dataframe.

Reviewed By: Balandat

Differential Revision: D56850035
…ook#2432)

Summary:

Changes `observations_from_data` and `observations_from_map_data` signatures, replacing arg `fit_abandoned: bool` -> `statuses_to_fit` and `statuses_to_fit_map_metric` which are both `Optional[List[TrialStatus]]`. In `observations_from_data`, these default to `None` in which case `{TrialStatus.COMPLETED}` is used for any MapMetrics, else `NON_ABANDONED_STATUSES`, i.e., all trial statuses except abandoned. In `observations_from_map_data`, `NON_ABANDONED_STATUSES` are the default for all metrics.

NOTE: As of this diff, any rows of `Data.df` containing `metric_names` that don't exist on `experiment` will be filtered out ([pointer](https://www.internalfb.com/diff/D56634321?permalink=330145676765780)).

Reviewed By: saitcakmak

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

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

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 2d8fa34.

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