class_docstr: The Scale Location plot compares the square root of the absolute standardized residuals $\sqrt{|    ilde r_i|}$
  versus the predicted values $\hat y_i$.
  Assuming that $Y=f(X)+\epsilon$ we can verify with this plot that $Var[\epsilon]=\sigma^2$.
  The fitted trend line should follow a straight line along the axis of predicted values.
class_docstr_tok: ["The","Scale","Location","plot","compares","the","square","root","of","the","absolute","standardized","residuals","$","\\sqrt","{","|","ilde","r_i|","}","$","versus","the","predicted","values","$","\\hat","y_i","$",".","Assuming","that","$","Y=f","(","X",")","+\\epsilon","$","we","can","verify","with","this","plot","that","$","Var","[","\\epsilon","]","=\\sigma^2","$",".","The","fitted","trend","line","should","follow","a","straight","line","along","the","axis","of","predicted","values","."]
code: def __scale_location_plot(
      fitted, sqrt_abs_standardized_residuals, split_origin
  ):
      sqrt_abs_standardized_residuals = pd.Series(
          sqrt_abs_standardized_residuals
      )
  
      if split_origin is not None:
          dataframe = pd.DataFrame(
              {
                  "Predictions": fitted,
                  "Split": split_origin,
                  "Standardized Residuals^1/2": sqrt_abs_standardized_residuals,
              }
          )
          fig = px.scatter(
              dataframe,
              x="Predictions",
              y="Standardized Residuals^1/2",
              trendline="lowess",
              color="Split",
              color_discrete_sequence=["blue", "green"],
              title="Scale-Location Plot",
              opacity=0.3,
          )
  
          fig.update_layout(showlegend=False)
      else:
          dataframe = pd.DataFrame(
              {
                  "Predictions": fitted,
                  "Standardized Residuals^1/2": sqrt_abs_standardized_residuals,
              }
          )
          fig = px.scatter(
              dataframe,
              x="Predictions",
              y="Standardized Residuals^1/2",
              trendline="lowess",
              title="Scale-Location Plot",
              opacity=0.3,
          )
  
      abs_sq_norm_resid = sqrt_abs_standardized_residuals.sort_values(
          ascending=False
      )
      abs_sq_norm_resid_top_3 = abs_sq_norm_resid[:3]
      for i in abs_sq_norm_resid_top_3.index:
          fig.add_annotation(
              x=fitted[i],
              y=sqrt_abs_standardized_residuals[i],
              text=f"~r_{i}^1/2",
          )
      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 ScaleLocationWidget obj's underlying member method code with example usage: obj.__scale_location_plot(fitted, sqrt_abs_standardized_residuals, split_origin) and returns: fig