class_docstr: Base class for inductive conformal predictors.
      
class_docstr_tok: ["Base","class","for","inductive","conformal","predictors","."]
docstr: Calibrate conformal predictor based on underlying nonconformity
  scorer.
  
  Parameters
  ----------
  x : numpy array of shape [n_samples, n_features]
      Inputs of examples for calibrating the conformal predictor.
  
  y : numpy array of shape [n_samples, n_features]
      Outputs of examples for calibrating the conformal predictor.
  
  increment : boolean
      If ``True``, performs an incremental recalibration of the conformal
      predictor. The supplied ``x`` and ``y`` are added to the set of
      previously existing calibration examples, and the conformal
      predictor is then calibrated on both the old and new calibration
      examples.
  
  Returns
  -------
  None
docstr_tok: ["Calibrate","conformal","predictor","based","on","underlying","nonconformity","scorer",".","Parameters","--","--","--","--","--","x",":","numpy","array","of","shape","[","n_samples",",","n_features","]","Inputs","of","examples","for","calibrating","the","conformal","predictor",".","y",":","numpy","array","of","shape","[","n_samples",",","n_features","]","Outputs","of","examples","for","calibrating","the","conformal","predictor",".","increment",":","boolean","If","``","True","``",",","performs","an","incremental","recalibration","of","the","conformal","predictor",".","The","supplied","``","x","``","and","``","y","``","are","added","to","the","set","of","previously","existing","calibration","examples",",","and","the","conformal","predictor","is","then","calibrated","on","both","the","old","and","new","calibration","examples",".","Returns","--","--","--","-","None"]
code: def calibrate(self, x, y, increment=False):
      """Calibrate conformal predictor based on underlying nonconformity
      scorer.
  
      Parameters
      ----------
      x : numpy array of shape [n_samples, n_features]
          Inputs of examples for calibrating the conformal predictor.
  
      y : numpy array of shape [n_samples, n_features]
          Outputs of examples for calibrating the conformal predictor.
  
      increment : boolean
          If ``True``, performs an incremental recalibration of the conformal
          predictor. The supplied ``x`` and ``y`` are added to the set of
          previously existing calibration examples, and the conformal
          predictor is then calibrated on both the old and new calibration
          examples.
  
      Returns
      -------
      None
      """
      self._calibrate_hook(x, y, increment)
      self._update_calibration_set(x, y, increment)
  
      if self.conditional:
          category_map = np.array(
              [self.condition((x[i, :], y[i])) for i in range(y.size)]
          )
          self.categories = np.unique(category_map)
          self.cal_scores = defaultdict(partial(np.ndarray, 0))
  
          for cond in self.categories:
              idx = category_map == cond
              cal_scores = self.nc_function.score(
                  self.cal_x[idx, :], self.cal_y[idx]
              )
              self.cal_scores[cond] = np.sort(cal_scores)[::-1]
      else:
          self.categories = np.array([0])
          cal_scores = self.nc_function.score(self.cal_x, self.cal_y)
          self.cal_scores = {0: np.sort(cal_scores)[::-1]}
  
      if self.cal_size:
          self.cal_scores = self._reduce_scores()
  
imports: from collections import defaultdict
  from functools import partial
  from typing import Optional, Union
  import numpy
  from sklearn.base import BaseEstimator
  from lightwood.analysis.nc.base import RegressorMixin, ClassifierMixin, TSMixin
  from types import FunctionType
label_desc: Use image node_id 3 for calling the BaseIcp obj's underlying member method code with example usage: obj.calibrate(x, y, increment) without return types