code: def make_scorer_df(score_func, greater_is_better=True, **kwargs):
      """Make a scorer from a performance metric or loss function.
  
      This factory function wraps scoring functions for use in GridSearchCV
      and cross_val_score. It takes a score function, such as ``accuracy_score``,
      ``mean_squared_error``, ``adjusted_rand_index`` or ``average_precision``
      and returns a callable that scores an estimator's output.
  
      Modified from `sklearn.metrics.make_scorer` to work with
      estimators whose predict function returns a `pandas.DataFrame`
      with multiple columns, one of which contains the predicted values.
  
      Enabled any standard `score_func` to be used in grid search on a
      `~greykite.sklearn.estimator.base_forecast_estimator.BaseForecastEstimator`.
  
      Parameters
      ----------
      score_func : callable,
          Score function (or loss function) with signature
          ``score_func(y, y_pred, **kwargs)``.
  
      greater_is_better : boolean, default=True
          Whether score_func is a score function (default), meaning high is good,
          or a loss function, meaning low is good. In the latter case, the
          scorer object will sign-flip the outcome of the score_func.
  
      **kwargs : additional arguments
          Additional parameters to be passed to score_func.
  
      Returns
      -------
      scorer : callable
          Callable object that returns a scalar score; greater is better.
      """
      sign = 1 if greater_is_better else -1
      cls = _PredictScorerDF
      return cls(score_func, sign, kwargs)
  
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 2 for calling a global function with example usage: make_scorer_df(score_func, greater_is_better) and returns: cls