@@ -149,7 +149,6 @@ def plot_feature_importance_by_feature_plotly(
149
149
for metric_name , v in sensitivity_values .items ()
150
150
}
151
151
traces = []
152
- dropdown = []
153
152
categorical_features = []
154
153
if model is not None :
155
154
categorical_features = [
@@ -238,37 +237,16 @@ def plot_feature_importance_by_feature_plotly(
238
237
is_visible = [False ] * (len (sensitivity_values ) * len (df ))
239
238
for j in range (i * len (df ), (i + 1 ) * len (df )):
240
239
is_visible [j ] = True
241
- dropdown .append (
242
- {"args" : ["visible" , is_visible ], "label" : metric_name , "method" : "restyle" }
243
- )
244
240
if not traces :
245
241
raise NotImplementedError ("No traces found for metric" )
246
242
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
- ]
259
243
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
263
244
longest_label = max (len (f ) for f in features )
264
245
longest_metric = max (len (m ) for m in sensitivity_values .keys ())
265
246
layout = go .Layout (
266
- height = 200 + len (features ) * 20 ,
247
+ height = len (features ) * 20 ,
267
248
width = 10 * longest_label + max (10 * longest_metric , 400 ),
268
249
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 ,
272
250
annotations = compose_annotation (caption = caption ),
273
251
)
274
252
0 commit comments