Skip to content

Commit

Permalink
Drop values without metric readings in ParallelCoordinatesPlot (#2898)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #2898

Bugfix. If an arm does not have a value for its metric it will fail to plot. Noticed this while working on something else

Reviewed By: danielcohenlive

Differential Revision: D64496771

fbshipit-source-id: 5f15bd386f3858fab80e87edf1434955d8cf6bb4
  • Loading branch information
mpolson64 authored and facebook-github-bot committed Oct 18, 2024
1 parent f5d6d4c commit 4b1ba71
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions ax/analysis/plotly/parallel_coordinates.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _prepare_data(experiment: Experiment, metric: str) -> pd.DataFrame:
for arm in trial.arms
]

return pd.DataFrame.from_records(records)
return pd.DataFrame.from_records(records).dropna()


def _prepare_plot(df: pd.DataFrame, metric_name: str) -> go.Figure:
Expand All @@ -96,10 +96,7 @@ def _prepare_plot(df: pd.DataFrame, metric_name: str) -> go.Figure:

return go.Figure(
go.Parcoords(
line={
"color": df[metric_name],
"showscale": True,
},
line={"color": df[metric_name], "showscale": True},
dimensions=[
*parameter_dimensions,
{
Expand Down

0 comments on commit 4b1ba71

Please sign in to comment.