class_docstr: The QQ plot compares the quantiles of the empirical residuals to the theoretical quantiles of a standard normal distribution $N(0, 1)$.
  Assuming that $Y=f(X)+\epsilon$ we can verify with this plot that $\epsilon ~ N(\mu, \sigma^2)$.
  If the error terms actually originate from a normal distribution, then the data points will scatter just slightly
  around the red straight line.
class_docstr_tok: ["The","QQ","plot","compares","the","quantiles","of","the","empirical","residuals","to","the","theoretical","quantiles","of","a","standard","normal","distribution","$","N","(","0",",","1",")","$",".","Assuming","that","$","Y=f","(","X",")","+\\epsilon","$","we","can","verify","with","this","plot","that","$","\\epsilon","~","N","(","\\mu",",","\\sigma^2",")","$",".","If","the","error","terms","actually","originate","from","a","normal","distribution",",","then","the","data","points","will","scatter","just","slightly","around","the","red","straight","line","."]
code: def __qq_plot(
      self,
      standardized_residuals: np.ndarray,
      split_origin: np.array = None,
  ) -> go.Figure:
      (osm, osr), (slope, intercept) = self.__get_qq(
          standardized_residuals=standardized_residuals
      )
      fig = go.Figure()
  
      if split_origin is not None:
          # calculate the sorted split origin list w.r.t to the standardized residuals
          # with this list we know which (theoretical quantile | empirical quantile) point belongs to which origin
          sorted_split_origin = np.array(
              [
                  origin
                  for (_, origin) in sorted(
                      enumerate(split_origin),
                      key=lambda idx_value: standardized_residuals[
                          idx_value[0]
                      ],
                  )
              ]
          )
          colors = sorted_split_origin.copy()
          colors[sorted_split_origin == "train"] = "blue"
          colors[sorted_split_origin == "test"] = "green"
          fig.add_scatter(
              x=osm,
              y=osr,
              mode="markers",
              name="quantiles",
              marker=dict(color=colors),
              customdata=sorted_split_origin,
              hovertemplate="%{x},%{y} (%{customdata})",
              opacity=0.7,
          )
      else:
          fig.add_scatter(
              x=osm,
              y=osr,
              mode="markers",
              name="quantiles",
              opacity=0.7,
          )
  
      x = np.array([osm[0], osm[-1]])
      fig.add_scatter(
          x=x, y=intercept + slope * x, mode="lines", name="OLS"
      )
      fig.layout.update(
          autosize=True,
          showlegend=False,
          title="Normal QQ-Plot",
          xaxis_title="Theoretical Quantiles",
          yaxis_title="Standardized Residuals",
      )
      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 3 for calling the QQPlotWidget obj's underlying member method code with example usage: obj.__qq_plot(standardized_residuals, split_origin) and returns: fig