Skip to content

Commit

Permalink
Do not plot running or early stopped trials in Scatter, ParallelCoord…
Browse files Browse the repository at this point in the history
…inates

Summary: As titled. I noticed this made the parallel coordinates plot esp. look bad while working on tutorials, where it made bad parameterization that got early stopped look really bad (since they were not full fidelity readings)

Differential Revision: D70262111
  • Loading branch information
mpolson64 authored and facebook-github-bot committed Feb 26, 2025
1 parent 625f8f6 commit 64d6d23
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ax/analysis/plotly/parallel_coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ def _prepare_data(experiment: Experiment, metric: str) -> pd.DataFrame:
}
for trial in experiment.trials.values()
for arm in trial.arms
# Do not plot running or early stopped trials since their terminal point does
# not represent full fidelity.
if trial.status.is_terminal and not trial.status.is_early_stopped
]

return pd.DataFrame.from_records(records).dropna()
Expand Down
9 changes: 8 additions & 1 deletion ax/analysis/plotly/scatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,14 @@ def _prepare_data(

# Filter for only rows with the relevant metric names
metric_name_mask = data["metric_name"].isin([x_metric_name, y_metric_name])
filtered = data[metric_name_mask][
# Do not plot running or early stopped trials since their terminal point does not
# represent full fidelity.
status_mask = (
data["trial_status"] == "COMPLETED"
or data["trial_status"] == "FAILED"
or data["trial_status"] == "ABANDONED"
)
filtered = data[metric_name_mask & status_mask][
["trial_index", "arm_name", "metric_name", "mean"]
]

Expand Down

0 comments on commit 64d6d23

Please sign in to comment.