docstr: Evaluates predicted target values for ``X`` relative to ``y_true``.
  
  Modified from `sklearn.metrics.scorer._PredictScorer` to work with
  estimators that return a `pandas.DataFrame` with multiple
  columns, one of which contains the predicted values (``PREDICTED_COL``).
  
  Parameters
  ----------
  method_caller : callable
      Returns predictions given an estimator, method name, and other
      arguments, potentially caching results.
  estimator : `BaseForecastEstimator`
      Trained estimator to use for scoring. Must have a `predict`
      method that returns a pandas.DataFrame with a column
      :const:`~greykite.common.constants.PREDICTED_COL`.
      This column is the predicted value used to compute the score.
  X : array-like or sparse matrix
      Test data that will be fed to estimator.predict.
  y_true : array-like
      Gold standard target values for X.
  sample_weight : array-like, optional (default=None)
      Sample weights.
  
  Returns
  -------
  score : float
      Score function applied to prediction of estimator on X.
docstr_tok: ["Evaluates","predicted","target","values","for","``","X","``","relative","to","``","y_true","``",".","Modified","from","`","sklearn.metrics.scorer._PredictScorer","`","to","work","with","estimators","that","return","a","`","pandas.DataFrame","`","with","multiple","columns",",","one","of","which","contains","the","predicted","values","(","``","PREDICTED_COL","``",")",".","Parameters","--","--","--","--","--","method_caller",":","callable","Returns","predictions","given","an","estimator",",","method","name",",","and","other","arguments",",","potentially","caching","results",".","estimator",":","`","BaseForecastEstimator","`","Trained","estimator","to","use","for","scoring",".","Must","have","a","`","predict","`","method","that","returns","a","pandas.DataFrame","with","a","column",":","const",":","`","~greykite.common.constants.PREDICTED_COL","`",".","This","column","is","the","predicted","value","used","to","compute","the","score",".","X",":","array-like","or","sparse","matrix","Test","data","that","will","be","fed","to","estimator.predict",".","y_true",":","array-like","Gold","standard","target","values","for","X.","sample_weight",":","array-like",",","optional","(","default=None",")","Sample","weights",".","Returns","--","--","--","-","score",":","float","Score","function","applied","to","prediction","of","estimator","on","X","."]
code: def _score(
      self, method_caller, estimator, X, y_true, sample_weight=None
  ):
      """Evaluates predicted target values for ``X`` relative to ``y_true``.
  
      Modified from `sklearn.metrics.scorer._PredictScorer` to work with
      estimators that return a `pandas.DataFrame` with multiple
      columns, one of which contains the predicted values (``PREDICTED_COL``).
  
      Parameters
      ----------
      method_caller : callable
          Returns predictions given an estimator, method name, and other
          arguments, potentially caching results.
      estimator : `BaseForecastEstimator`
          Trained estimator to use for scoring. Must have a `predict`
          method that returns a pandas.DataFrame with a column
          :const:`~greykite.common.constants.PREDICTED_COL`.
          This column is the predicted value used to compute the score.
      X : array-like or sparse matrix
          Test data that will be fed to estimator.predict.
      y_true : array-like
          Gold standard target values for X.
      sample_weight : array-like, optional (default=None)
          Sample weights.
  
      Returns
      -------
      score : float
          Score function applied to prediction of estimator on X.
      """
      y_pred = method_caller(estimator, "predict", X)[PREDICTED_COL]
      if sample_weight is not None:
          score = self._score_func(
              y_true,
              y_pred,
              sample_weight=sample_weight,
              **self._kwargs,
          )
      else:
          score = self._score_func(y_true, y_pred, **self._kwargs)
  
      if score is None:
          # Set to np.nan if undefined
          # (e.g. if MAPE, correlation, R2, or R2_null_model_score has division by 0).
          # This function cannot not return None to avoid the following error in
          # sklearn grid search (sklearn/model_selection/_validation.py:618):
          #   `scoring must return a number, got None (<class 'NoneType'>) instead. (scorer=score)`
          # `np.nan` is also the default value for `error_score` in
          # `~sklearn.model_selection.RandomizedSearchCV`. This split score is set
          # to this value if fit fails.
          warnings.warn(
              "Score is undefined for this split, setting to `np.nan`."
          )
          score = np.nan
  
      return self._sign * score
  
file_path: greykite/greykite/sklearn/sklearn_scorer.py
imports: import warnings
  from functools import partial
  import numpy
  from greykite.common.constants import PREDICTED_COL
label_desc: Use image node_id 1 for calling the _PredictScorerDF obj's underlying member method code with example usage: obj._score(method_caller, estimator, X, y_true, sample_weight) and returns: unknown