parameters: (self, X, y, sample_weight=None)
return_statement: return self
docstring: Fit Ridge classifier with cv.
  
          Parameters
          ----------
          X : ndarray of shape (n_samples, n_features)
              Training vectors, where n_samples is the number of samples
              and n_features is the number of features. When using GCV,
              will be cast to float64 if necessary.
  
          y : ndarray of shape (n_samples,)
              Target values. Will be cast to X's dtype if necessary.
  
          sample_weight : float or ndarray of shape (n_samples,), default=None
              Individual weights for each sample. If given a float, every sample
              will have the same weight.
  
          Returns
          -------
          self : object
docstring_summary: Fit Ridge classifier with cv.
docstring_tokens: Fit Ridge classifier with cv .
function: def fit(self, X, y, sample_weight=None):
          """Fit Ridge classifier with cv.
  
          Parameters
          ----------
          X : ndarray of shape (n_samples, n_features)
              Training vectors, where n_samples is the number of samples
              and n_features is the number of features. When using GCV,
              will be cast to float64 if necessary.
  
          y : ndarray of shape (n_samples,)
              Target values. Will be cast to X's dtype if necessary.
  
          sample_weight : float or ndarray of shape (n_samples,), default=None
              Individual weights for each sample. If given a float, every sample
              will have the same weight.
  
          Returns
          -------
          self : object
          """
          X, y = check_X_y(X, y, accept_sparse=['csr', 'csc', 'coo'],
                           multi_output=True, y_numeric=False)
          sample_weight = _check_sample_weight(sample_weight, X, dtype=X.dtype)
  
          self._label_binarizer = LabelBinarizer(pos_label=1, neg_label=-1)
          Y = self._label_binarizer.fit_transform(y)
          if not self._label_binarizer.y_type_.startswith('multilabel'):
              y = column_or_1d(y, warn=True)
  
          if self.class_weight:
              # modify the sample weights with the corresponding class weight
              sample_weight = (sample_weight *
                               compute_sample_weight(self.class_weight, y))
  
          _BaseRidgeCV.fit(self, X, Y, sample_weight=sample_weight)
          return self
function_tokens: def fit ( self , X , y , sample_weight = None ) : X , y = check_X_y ( X , y , accept_sparse = [ 'csr' , 'csc' , 'coo' ] , multi_output = True , y_numeric = False ) sample_weight = _check_sample_weight ( sample_weight , X , dtype = X . dtype ) self . _label_binarizer = LabelBinarizer ( pos_label = 1 , neg_label = - 1 ) Y = self . _label_binarizer . fit_transform ( y ) if not self . _label_binarizer . y_type_ . startswith ( 'multilabel' ) : y = column_or_1d ( y , warn = True ) if self . class_weight : # modify the sample weights with the corresponding class weight sample_weight = ( sample_weight * compute_sample_weight ( self . class_weight , y ) ) _BaseRidgeCV . fit ( self , X , Y , sample_weight = sample_weight ) return self