class_docstr: The Tunkey Anscombe Plot compares the residuals $r_i=y_i-\hat y_i$ versus the predicted values $\hat y_i$.
  Assuming that $Y=f(X)+\epsilon$ we can verify with this plot that $E[\epsilon]=0$.
  The fitted trend line should follow a straight line along the axis of predicted values at the position 0 on the
  residual axis.
class_docstr_tok: ["The","Tunkey","Anscombe","Plot","compares","the","residuals","$","r_i=y_i-\\hat","y_i","$","versus","the","predicted","values","$","\\hat","y_i","$",".","Assuming","that","$","Y=f","(","X",")","+\\epsilon","$","we","can","verify","with","this","plot","that","$","E","[","\\epsilon","]","=0","$",".","The","fitted","trend","line","should","follow","a","straight","line","along","the","axis","of","predicted","values","at","the","position","0","on","the","residual","axis","."]
code: def __tukey_anscombe_plot(predictions, residuals, split_origin):
      if split_origin is not None:
          dataframe = pd.DataFrame(
              {
                  "Predictions": predictions,
                  "Residuals": residuals,
                  "Split": split_origin,
              }
          )
  
          fig = px.scatter(
              dataframe,
              x="Predictions",
              y="Residuals",
              trendline="lowess",
              color="Split",
              color_discrete_sequence=["blue", "green"],
              title="Tukey-Anscombe Plot",
              opacity=0.3,
          )
  
          fig.update_layout(showlegend=False)
      else:
          dataframe = pd.DataFrame(
              {"Predictions": predictions, "Residuals": residuals}
          )
  
          fig = px.scatter(
              dataframe,
              x="Predictions",
              y="Residuals",
              trendline="lowess",
              title="Tukey-Anscombe Plot",
              opacity=0.3,
          )
  
      model_abs_resid = pd.Series(np.abs(residuals))
      abs_resid = model_abs_resid.sort_values(ascending=False)
      abs_resid_top_3 = abs_resid[:3]
      for i in abs_resid_top_3.index:
          fig.add_annotation(
              x=predictions[i], y=residuals[i], text=f"r_{i}"
          )
      fig.update_annotations(
          dict(
              xref="x",
              yref="y",
              showarrow=True,
              arrowhead=7,
              ax=0,
              ay=-40,
          )
      )
      return fig
  
imports: from typing import List, Optional
  import numpy
  import pandas
  import plotly.express
  import plotly.graph_objects
  from ipywidgets import Layout, widgets
  from plotly.basewidget import BaseFigureWidget
  from scipy import stats
  import pycaret.internal.plots.helper
  from pycaret.internal.display import CommonDisplay
  from pycaret.internal.display.display_backend import ColabBackend, DatabricksBackend
  from pycaret.internal.logging import get_logger
  from pycaret.internal.validation import fit_if_not_fitted
label_desc: Use image node_id 2 for calling the TukeyAnscombeWidget obj's underlying member method code with example usage: obj.__tukey_anscombe_plot(predictions, residuals, split_origin) and returns: fig