code: def plotly_predicted_vs_actual(
      y,
      preds,
      target="",
      units="",
      round=2,
      logs=False,
      log_x=False,
      log_y=False,
      idxs=None,
      index_name="index",
  ):
      """Generate graph showing predicted values from a regressor model vs actual
      values.
  
      Args:
          y (np.ndarray): Actual values
          preds (np.ndarray): Predicted values
          target (str, optional): Label for target. Defaults to "".
          units (str, optional): Units of target. Defaults to "".
          round (int, optional): Rounding to apply to floats. Defaults to 2.
          logs (bool, optional): Log both axis. Defaults to False.
          log_x (bool, optional): Log x axis. Defaults to False.
          log_y (bool, optional): Log y axis. Defaults to False.
          idxs (List[str], optional): list of identifiers for each observation. Defaults to None.
          index_name (str): identifier for idxs. Defaults to "index".
  
      Returns:
          Plotly fig
      """
  
      if idxs is not None:
          assert len(idxs) == len(preds)
          idxs = [str(idx) for idx in idxs]
      else:
          idxs = [str(i) for i in range(len(preds))]
  
      marker_text = [
          f"{index_name}: {idx}<br>Observed: {actual:.{round}f}<br>Prediction: {pred:.{round}f}"
          for idx, actual, pred in zip(idxs, y, preds)
      ]
  
      trace0 = go.Scattergl(
          x=y,
          y=preds,
          mode="markers",
          name=f"predicted {target}" + f" ({units})" if units else "",
          text=marker_text,
          hoverinfo="text",
      )
  
      sorted_y = np.sort(y)
      trace1 = go.Scattergl(
          x=sorted_y,
          y=sorted_y,
          mode="lines",
          name=f"observed {target}" + f" ({units})" if units else "",
          hoverinfo="none",
      )
  
      data = [trace0, trace1]
  
      layout = go.Layout(
          title=f"Predicted {target} vs Observed {target}",
          yaxis=dict(
              title=f"Predicted {target}"
              + (f" ({units})" if units else "")
          ),
          xaxis=dict(
              title=f"Observed {target}"
              + (f" ({units})" if units else "")
          ),
          plot_bgcolor="#fff",
          hovermode="closest",
      )
  
      fig = go.Figure(data, layout)
      if logs:
          fig.update_layout(xaxis_type="log", yaxis_type="log")
      if log_x:
          fig.update_layout(xaxis_type="log")
      if log_y:
          fig.update_layout(yaxis_type="log")
      fig.update_layout(margin=dict(t=40, b=40, l=40, r=40))
      return fig
  
imports: import warnings
  import numpy
  import pandas
  from pandas.api.types import is_numeric_dtype
  import plotly.graph_objs
  from plotly.subplots import make_subplots
  from sklearn.metrics import classification_report, confusion_matrix, precision_recall_curve, roc_curve, roc_auc_score, average_precision_score
  from .explainer_methods import matching_cols, safe_isinstance
label_desc: Use image node_id 15 for calling a global function with example usage: plotly_predicted_vs_actual(y, preds, target, units, round, logs, log_x, log_y, idxs, index_name) and returns: fig