Skip to content

Conversation

@saitcakmak
Copy link
Contributor

Summary:
This transform was popping the corresponding element from the metadata before adding it as a feature. This is fine for the most part, but it doesn't really have a significant benefit over just leaving the original in the metadata.

The problem with popping the element from the metadata is when doing this with ExperimentData. Even if we deepcopy a pandas dataframe, it does not deepcopy the underlying dictionary values. If we then transform the copy, we end up removing the metadata from the original as well, which leads to errors when doing cross validation with an adapter that uses these transforms (since we end up transforming multiple copies, and only the first one has the metadata).

This diff updates the transfrom to not remove the element from metadata.

Differential Revision: D79805146

facebook#4115)

Summary:

If any progression value is missing in `ObservationFeatures.metadata`, `MapKeyToFloat._transform_observation_feature` fills it with the upper bound of the corresponding parameter. This encodes the assumption that any data without a progression value corresponds to a completed trial (as a trial can be completed with `client.complete_trial` without providing progression).

The initial implementation of `transform_experiment_data` did not account for the possibility of NaN values in the corresponding index. This diff updates the method to check for NaN progression values and fill them with the target progression.

Reviewed By: ltiao

Differential Revision: D79750521
…iginal

Summary:
This transform was popping the corresponding element from the metadata before adding it as a feature. This is fine for the most part, but it doesn't really have a significant benefit over just leaving the original in the metadata.

The problem with popping the element from the metadata is when doing this with `ExperimentData`. Even if we `deepcopy` a pandas dataframe, it does not deepcopy the underlying dictionary values. If we then transform the copy, we end up removing the metadata from the original as well, which leads to errors when doing cross validation with an adapter that uses these transforms (since we end up transforming multiple copies, and only the first one has the metadata).

This diff updates the transfrom to not remove the element from metadata.

Differential Revision: D79805146
@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Aug 7, 2025
@facebook-github-bot
Copy link
Contributor

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

@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 96.29630% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 96.07%. Comparing base (b2f85d4) to head (b9ed854).

Files with missing lines Patch % Lines
ax/adapter/transforms/map_key_to_float.py 94.11% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4116      +/-   ##
==========================================
- Coverage   96.07%   96.07%   -0.01%     
==========================================
  Files         566      566              
  Lines       57027    57044      +17     
==========================================
+ Hits        54790    54806      +16     
- Misses       2237     2238       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in e71e598.

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