class_docstr: Conformal prediction dataclass
  
  Parameters
  ----------
  alpha : float or tuple
      user-specified significance level of the prediction interval, float if coverage error spread arbitrarily over
      left and right tails, tuple of two floats for different coverage error over left and right tails respectively
  method : str
      name of conformal prediction technique used
  
      Options
          * ``naive``: Naive or Absolute Residual
          * ``cqr``: Conformalized Quantile Regression
  n_forecasts : int
      optional, number of steps ahead of prediction time step to forecast
  quantiles : list
      optional, list of quantiles for quantile regression uncertainty estimate
class_docstr_tok: ["Conformal","prediction","dataclass","Parameters","--","--","--","--","--","alpha",":","float","or","tuple","user-specified","significance","level","of","the","prediction","interval",",","float","if","coverage","error","spread","arbitrarily","over","left","and","right","tails",",","tuple","of","two","floats","for","different","coverage","error","over","left","and","right","tails","respectively","method",":","str","name","of","conformal","prediction","technique","used","Options","*","``","naive","``",":","Naive","or","Absolute","Residual","*","``","cqr","``",":","Conformalized","Quantile","Regression","n_forecasts",":","int","optional",",","number","of","steps","ahead","of","prediction","time","step","to","forecast","quantiles",":","list","optional",",","list","of","quantiles","for","quantile","regression","uncertainty","estimate"]
docstr: Get the q_hat that is derived from the nonconformity scores.
  
  Parameters
  ----------
      df_cal : pd.DataFrame
          calibration dataframe
      noncon_scores : dict
          dictionary with one entry (symmetrical) or two entries (asymmetrical) of nonconformity scores
  
      Returns
      -------
          Dict[str, float]
              upper and lower q_hat value, or the one-sided prediction interval width
docstr_tok: ["Get","the","q_hat","that","is","derived","from","the","nonconformity","scores",".","Parameters","--","--","--","--","--","df_cal",":","pd.DataFrame","calibration","dataframe","noncon_scores",":","dict","dictionary","with","one","entry","(","symmetrical",")","or","two","entries","(","asymmetrical",")","of","nonconformity","scores","Returns","--","--","--","-","Dict","[","str",",","float","]","upper","and","lower","q_hat","value",",","or","the","one-sided","prediction","interval","width"]
code: def _get_q_hat(
      self, df_cal: pd.DataFrame, noncon_scores: dict
  ) -> dict:
      """Get the q_hat that is derived from the nonconformity scores.
  
      Parameters
      ----------
          df_cal : pd.DataFrame
              calibration dataframe
          noncon_scores : dict
              dictionary with one entry (symmetrical) or two entries (asymmetrical) of nonconformity scores
  
          Returns
          -------
              Dict[str, float]
                  upper and lower q_hat value, or the one-sided prediction interval width
  
      """
      # Get the q-hat index and value
      if self.method == "cqr" and self.symmetrical is False:
          noncon_scores_lo = noncon_scores["noncon_scores_lo"]
          noncon_scores_hi = noncon_scores["noncon_scores_hi"]
          q_hat_idx_lo = int(len(noncon_scores_lo) * self.alpha_lo)
          q_hat_idx_hi = int(len(noncon_scores_hi) * self.alpha_hi)
          q_hat_lo = noncon_scores_lo[-q_hat_idx_lo]
          q_hat_hi = noncon_scores_hi[-q_hat_idx_hi]
          return {"q_hat_lo": q_hat_lo, "q_hat_hi": q_hat_hi}
      else:
          noncon_scores = noncon_scores["noncon_scores"]
          q_hat_idx = int(len(noncon_scores) * self.alpha)
          q_hat = noncon_scores[-q_hat_idx]
          return {"q_hat_sym": q_hat}
  
file_path: neural_prophet/neuralprophet/uncertainty.py
imports: import re
  from dataclasses import dataclass
  from typing import Any, List, Tuple, Union
  import matplotlib
  import numpy
  import pandas
  from neuralprophet.plot_forecast_matplotlib import plot_interval_width_per_timestep, plot_nonconformity_scores
  from neuralprophet.plot_forecast_plotly import plot_interval_width_per_timestep
  from neuralprophet.plot_forecast_plotly import plot_nonconformity_scores
  from neuralprophet.plot_utils import log_warning_deprecation_plotly, select_plotting_backend
label_desc: Use image node_id 4 for calling the Conformal obj's underlying member method code with example usage: obj._get_q_hat(df_cal, noncon_scores) and returns: dict, dict