code: def score(self, X, y=None, sample_weight=None):
          
  
          Xt, yt, swt = self._transform(X, y, sample_weight)
  
          self.N_test = len(yt)
  
          score_params = {}
          if swt is not None:
              score_params['sample_weight'] = swt
  
          if self.scorer is None:
              return self._final_estimator.score(Xt, yt, **score_params)
  
          return self.scorer(self._final_estimator, Xt, yt, **score_params)
docs: Apply transforms, and score with the final estimator
  
          Parameters
          ----------
          X : iterable
              Data to predict on. Must fulfill input requirements of first step
              of the pipeline.
          y : iterable, default=None
              Targets used for scoring. Must fulfill label requirements for all
              steps of the pipeline.
          sample_weight : array-like, default=None
              If not None, this argument is passed as ``sample_weight`` keyword
              argument to the ``score`` method of the final estimator.
  
          Returns
          -------
          score : float