class_docstr: Check for systematic error and abnormal shape in the regression error distribution.
  
  The check shows the distribution of the regression error, and enables to set conditions on two
  of the distribution parameters: Systematic error and Kurtosis value.
  Kurtosis is a measure of the shape of the distribution, helping us understand if the distribution
  is significantly "wider" from a normal distribution.
  Systematic error, otherwise known as the error bias, is the mean prediction error of the model.
  
  Parameters
  ----------
  n_top_samples : int , default: 3
      amount of samples to show which have the largest under / over estimation errors.
  n_bins : int , default: 40
      number of bins to use for the histogram.
  n_samples : int , default: 1_000_000
      number of samples to use for this check.
  random_state : int, default: 42
      random seed for all check internals.
class_docstr_tok: ["Check","for","systematic","error","and","abnormal","shape","in","the","regression","error","distribution",".","The","check","shows","the","distribution","of","the","regression","error",",","and","enables","to","set","conditions","on","two","of","the","distribution","parameters",":","Systematic","error","and","Kurtosis","value",".","Kurtosis","is","a","measure","of","the","shape","of","the","distribution",",","helping","us","understand","if","the","distribution","is","significantly","``","wider","''","from","a","normal","distribution",".","Systematic","error",",","otherwise","known","as","the","error","bias",",","is","the","mean","prediction","error","of","the","model",".","Parameters","--","--","--","--","--","n_top_samples",":","int",",","default",":","3","amount","of","samples","to","show","which","have","the","largest","under","\/","over","estimation","errors",".","n_bins",":","int",",","default",":","40","number","of","bins","to","use","for","the","histogram",".","n_samples",":","int",",","default",":","1_000_000","number","of","samples","to","use","for","this","check",".","random_state",":","int",",","default",":","42","random","seed","for","all","check","internals","."]
docstr: Run check.
  
  Returns
  -------
  CheckResult
      value is the kurtosis value (Fisher’s definition (normal ==> 0.0)).
      display is histogram of error distribution and the largest prediction errors.
  
  Raises
  ------
  DeepchecksValueError
      If the object is not a Dataset instance with a label
docstr_tok: ["Run","check",".","Returns","--","--","--","-","CheckResult","value","is","the","kurtosis","value","(","Fisher","\u2019","s","definition","(","normal","==",">","0.0",")",")",".","display","is","histogram","of","error","distribution","and","the","largest","prediction","errors",".","Raises","--","--","--","DeepchecksValueError","If","the","object","is","not","a","Dataset","instance","with","a","label"]
code: def run_logic(self, context: Context, dataset_kind) -> CheckResult:
      """Run check.
  
      Returns
      -------
      CheckResult
          value is the kurtosis value (Fisher’s definition (normal ==> 0.0)).
          display is histogram of error distribution and the largest prediction errors.
  
      Raises
      ------
      DeepchecksValueError
          If the object is not a Dataset instance with a label
      """
      dataset = context.get_data_by_kind(dataset_kind).sample(
          self.n_samples, random_state=self.random_state
      )
      context.assert_regression_task()
      model = context.model
      y_test = dataset.label_col
  
      y_pred = model.predict(dataset.features_columns)
      y_pred = pd.Series(
          y_pred,
          name="predicted " + str(dataset.label_name),
          index=y_test.index,
      )
  
      diff = y_test - y_pred
      kurtosis_value = kurtosis(diff)
  
      if context.with_display:
          n_largest_diff = diff.nlargest(self.n_top_samples)
          n_largest_diff.name = (
              str(dataset.label_name) + " Prediction Difference"
          )
          n_largest = pd.concat(
              [
                  dataset.data.loc[n_largest_diff.index],
                  y_pred.loc[n_largest_diff.index],
                  n_largest_diff,
              ],
              axis=1,
          )
  
          n_smallest_diff = diff.nsmallest(self.n_top_samples)
          n_smallest_diff.name = (
              str(dataset.label_name) + " Prediction Difference"
          )
          n_smallest = pd.concat(
              [
                  dataset.data.loc[n_smallest_diff.index],
                  y_pred.loc[n_smallest_diff.index],
                  n_smallest_diff,
              ],
              axis=1,
          )
          fig = px.histogram(
              x=diff.values,
              nbins=self.n_bins,
              title="Regression Error Distribution",
              labels={
                  "x": f"{dataset.label_name} prediction error",
                  "y": "Count",
              },
              height=500,
          )
  
          fig.add_vline(
              x=np.median(diff),
              line_dash="dash",
              line_color="purple",
              annotation_text="median",
              annotation_position="top left"
              if np.median(diff) < np.mean(diff)
              else "top right",
          )
          fig.add_vline(
              x=np.mean(diff),
              line_dash="dot",
              line_color="purple",
              annotation_text="mean",
              annotation_position="top right"
              if np.median(diff) < np.mean(diff)
              else "top left",
          )
  
          display = [
              fig,
              "Largest over estimation errors:",
              n_largest,
              "Largest under estimation errors:",
              n_smallest,
          ]
      else:
          display = None
  
      results = {
          "Mean Prediction Error": np.mean(diff),
          "Median Prediction Error": np.median(diff),
          "Kurtosis Value": kurtosis_value,
          "RMSE": mean_squared_error(y_test, y_pred, squared=False),
      }
  
      return CheckResult(value=results, display=display)
  
file_path: deepchecks/deepchecks/tabular/checks/model_evaluation/regression_error_distribution.py
imports: from typing import Dict
  import numpy
  import pandas
  import plotly.express
  from scipy.stats import kurtosis
  from sklearn.metrics import mean_squared_error
  from deepchecks.core import CheckResult, ConditionCategory, ConditionResult
  from deepchecks.tabular import Context, SingleDatasetCheck
  from deepchecks.utils.strings import format_number
label_desc: Use image node_id 2 for calling the RegressionErrorDistribution obj's underlying member method code with example usage: obj.run_logic(context, dataset_kind) and returns: CheckResult