class_docstr: Diagnostic plots to identify potential problems in a linear regression fit.
  Mainly,
      a. non-linearity of data
      b. Correlation of error terms
      c. non-constant variance 
      d. outliers
      e. high-leverage points
      f. collinearity
  
  Author:
      Prajwal Kafle (p33ajkafle@gmail.com, where 3 = r)
      Does not come with any sort of warranty. 
      Please test the code one your end before using.
class_docstr_tok: ["Diagnostic","plots","to","identify","potential","problems","in","a","linear","regression","fit",".","Mainly",",","a.","non-linearity","of","data","b",".","Correlation","of","error","terms","c.","non-constant","variance","d.","outliers","e.","high-leverage","points","f.","collinearity","Author",":","Prajwal","Kafle","(","p33ajkafle","@","gmail.com",",","where","3","=","r",")","Does","not","come","with","any","sort","of","warranty",".","Please","test","the","code","one","your","end","before","using","."]
docstr: Sqrt(Standarized Residual) vs Fitted values plot
  
  Used to check homoscedasticity of the residuals.
  Horizontal line will suggest so.
docstr_tok: ["Sqrt","(","Standarized","Residual",")","vs","Fitted","values","plot","Used","to","check","homoscedasticity","of","the","residuals",".","Horizontal","line","will","suggest","so","."]
code: def scale_location_plot(self, ax=None):
      """
      Sqrt(Standarized Residual) vs Fitted values plot
  
      Used to check homoscedasticity of the residuals.
      Horizontal line will suggest so.
      """
      if ax is None:
          fig, ax = plt.subplots()
  
      residual_norm_abs_sqrt = np.sqrt(np.abs(self.residual_norm))
  
      ax.scatter(self.y_predict, residual_norm_abs_sqrt, alpha=0.5)
      sns.regplot(
          x=self.y_predict,
          y=residual_norm_abs_sqrt,
          scatter=False,
          ci=False,
          lowess=True,
          line_kws={"color": "red", "lw": 1, "alpha": 0.8},
          ax=ax,
      )
  
      # annotations
      abs_sq_norm_resid = np.flip(np.argsort(residual_norm_abs_sqrt), 0)
      abs_sq_norm_resid_top_3 = abs_sq_norm_resid[:3]
      for i in abs_sq_norm_resid_top_3:
          ax.annotate(
              i,
              xy=(self.y_predict[i], residual_norm_abs_sqrt[i]),
              color="C3",
          )
      ax.set_title("Scale-Location", fontweight="bold")
      ax.set_xlabel("Fitted values")
      ax.set_ylabel(r"$\sqrt{|\mathrm{Standardized\ Residuals}|}$")
      return ax
  
file_path: statsmodels/examples/python/linear_regression_diagnostics_plots.py
imports: import statsmodels
  import statsmodels.formula.api
  import pandas
  import numpy
  import seaborn
  from statsmodels.tools.tools import maybe_unwrap_results
  from statsmodels.graphics.gofplots import ProbPlot
  from statsmodels.stats.outliers_influence import variance_inflation_factor
  import matplotlib.pyplot
  from typing import Type
label_desc: Use image node_id 5 for calling the Linear_Reg_Diagnostic obj's underlying member method code with example usage: obj.scale_location_plot(ax) and returns: ax