parameters: (self, X, y, sample_weight=None)
return_statement: return self
docstring: Calibrate the fitted model
  
          Parameters
          ----------
          X : array-like, shape (n_samples, n_features)
              Training data.
  
          y : array-like, shape (n_samples,)
              Target values.
  
          sample_weight : array-like of shape (n_samples,), default=None
              Sample weights. If None, then samples are equally weighted.
  
          Returns
          -------
          self : object
              Returns an instance of self.
docstring_summary: Calibrate the fitted model
docstring_tokens: Calibrate the fitted model
function: def fit(self, X, y, sample_weight=None):
          """Calibrate the fitted model
  
          Parameters
          ----------
          X : array-like, shape (n_samples, n_features)
              Training data.
  
          y : array-like, shape (n_samples,)
              Target values.
  
          sample_weight : array-like of shape (n_samples,), default=None
              Sample weights. If None, then samples are equally weighted.
  
          Returns
          -------
          self : object
              Returns an instance of self.
          """
  
          self.label_encoder_ = LabelEncoder()
          if self.classes is None:
              self.label_encoder_.fit(y)
          else:
              self.label_encoder_.fit(self.classes)
  
          self.classes_ = self.label_encoder_.classes_
          Y = label_binarize(y, self.classes_)
  
          df, idx_pos_class = self._preproc(X)
          self.calibrators_ = []
  
          for k, this_df in zip(idx_pos_class, df.T):
              if self.method == 'isotonic':
                  calibrator = IsotonicRegression(out_of_bounds='clip')
              elif self.method == 'sigmoid':
                  calibrator = _SigmoidCalibration()
              else:
                  raise ValueError('method should be "sigmoid" or '
                                   '"isotonic". Got %s.' % self.method)
              calibrator.fit(this_df, Y[:, k], sample_weight)
              self.calibrators_.append(calibrator)
  
          return self
function_tokens: def fit ( self , X , y , sample_weight = None ) : self . label_encoder_ = LabelEncoder ( ) if self . classes is None : self . label_encoder_ . fit ( y ) else : self . label_encoder_ . fit ( self . classes ) self . classes_ = self . label_encoder_ . classes_ Y = label_binarize ( y , self . classes_ ) df , idx_pos_class = self . _preproc ( X ) self . calibrators_ = [ ] for k , this_df in zip ( idx_pos_class , df . T ) : if self . method == 'isotonic' : calibrator = IsotonicRegression ( out_of_bounds = 'clip' ) elif self . method == 'sigmoid' : calibrator = _SigmoidCalibration ( ) else : raise ValueError ( 'method should be "sigmoid" or ' '"isotonic". Got %s.' % self . method ) calibrator . fit ( this_df , Y [ : , k ] , sample_weight ) self . calibrators_ . append ( calibrator ) return self