Skip to content

Commit f2c2695

Browse files
Daniel Cohenfacebook-github-bot
Daniel Cohen
authored andcommitted
Use InteractionAnalysis (#3016)
Summary: Pull Request resolved: #3016 Reviewed By: mgarrard Differential Revision: D64972635 fbshipit-source-id: 7ce5f735f766f79089cc68f6cfde60f04593c8c9
1 parent 05bbc60 commit f2c2695

File tree

1 file changed

+1
-23
lines changed

1 file changed

+1
-23
lines changed

ax/plot/feature_importances.py

+1-23
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,6 @@ def plot_feature_importance_by_feature_plotly(
149149
for metric_name, v in sensitivity_values.items()
150150
}
151151
traces = []
152-
dropdown = []
153152
categorical_features = []
154153
if model is not None:
155154
categorical_features = [
@@ -238,37 +237,16 @@ def plot_feature_importance_by_feature_plotly(
238237
is_visible = [False] * (len(sensitivity_values) * len(df))
239238
for j in range(i * len(df), (i + 1) * len(df)):
240239
is_visible[j] = True
241-
dropdown.append(
242-
{"args": ["visible", is_visible], "label": metric_name, "method": "restyle"}
243-
)
244240
if not traces:
245241
raise NotImplementedError("No traces found for metric")
246242

247-
updatemenus = [
248-
{
249-
"x": 0,
250-
"y": 1,
251-
"yanchor": "top",
252-
"xanchor": "left",
253-
"buttons": dropdown,
254-
"pad": {
255-
"t": -40
256-
}, # hack to put dropdown below title regardless of number of features
257-
}
258-
]
259243
features = list(list(sensitivity_values.values())[0].keys())
260-
title = "Normalized parameter sensitivity" if relative else "Parameter sensitivity"
261-
if importance_measure:
262-
title = title + " using " + importance_measure
263244
longest_label = max(len(f) for f in features)
264245
longest_metric = max(len(m) for m in sensitivity_values.keys())
265246
layout = go.Layout(
266-
height=200 + len(features) * 20,
247+
height=len(features) * 20,
267248
width=10 * longest_label + max(10 * longest_metric, 400),
268249
hovermode="closest",
269-
margin=go.layout.Margin(l=8 * min(max(len(idx) for idx in features), 75)), # noqa E741
270-
title=title,
271-
updatemenus=updatemenus,
272250
annotations=compose_annotation(caption=caption),
273251
)
274252

0 commit comments

Comments
 (0)