class_docstr: Base class for inductive conformal predictors.
      
class_docstr_tok: ["Base","class","for","inductive","conformal","predictors","."]
code: def __init__(
      self,
      nc_function: FunctionType,
      condition: Union[bool, FunctionType] = None,
      cal_size: int = None,
  ):
      self.cal_x, self.cal_y = None, None
      self.nc_function = nc_function
      self.cal_size = (
          cal_size  # if specified, defines size of calibration set
      )
  
      # Check if condition-parameter is the default function (i.e.,
      # lambda x: 0). This is so we can safely clone the object without
      # the clone accidentally having self.conditional = True.
      def default_condition(x):
          return 0
  
      is_default = callable(condition) and (
          condition.__code__.co_code
          == default_condition.__code__.co_code
      )
  
      if is_default:
          self.condition = condition
          self.conditional = False
      elif callable(condition):
          self.condition = condition
          self.conditional = True
      else:
          self.condition = lambda x: 0
          self.conditional = False
  
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 1 to create a new BaseIcp object from inherited base classes: BaseEstimator with example: obj = BaseIcp(nc_function, condition, cal_size)