code: def plot_relative_feature_importance_plotly(
      model: ModelBridge,
  ) -> go.Figure:
      """Create a stacked bar chart of feature importances per metric"""
      importances = []
      for metric_name in sorted(model.metric_names):
          try:
              vals: Dict[str, Any] = model.feature_importances(
                  metric_name
              )
              vals["index"] = metric_name
              importances.append(vals)
          except Exception:
              logger.warning(
                  "Model for {} does not support feature importances.".format(
                      metric_name
                  )
              )
      df = pd.DataFrame(importances)
      df.set_index("index", inplace=True)
      df = df.div(df.sum(axis=1), axis=0)
      data = [
          go.Bar(
              y=df.index,
              x=df[column_name],
              name=column_name,
              orientation="h",
          )
          for column_name in df.columns
      ]
      layout = go.Layout(
          margin=go.layout.Margin(l=250),  # noqa E741
          barmode="group",
          yaxis={"title": ""},
          xaxis={"title": "Relative Parameter importance"},
          showlegend=False,
          title="Relative Parameter Importance per Metric",
      )
      return go.Figure(data=data, layout=layout)
  
file_path: Ax/ax/plot/feature_importances.py
imports: from logging import Logger
  from typing import Any, Dict, Optional, Union
  import numpy
  import pandas
  import plotly.graph_objs
  from ax.exceptions.core import NoDataError
  from ax.modelbridge import ModelBridge
  from ax.plot.base import AxPlotConfig, AxPlotTypes
  from ax.plot.helper import compose_annotation
  from ax.utils.common.logger import get_logger
  from plotly import subplots
label_desc: Use image node_id 7 for calling a global function with example usage: plot_relative_feature_importance_plotly(model) and returns: go