class_docstr: A base class for forecast models. Fits a timeseries and predicts future values
  
  Parameters
  ----------
  score_func : callable, optional, default=mean_squared_error
      Function to calculate model R2_null_model_score score,
      with signature (actual, predicted).
      `actual`, `predicted` are array-like with the same shape.
      Smaller values are better.
  
  coverage : float, optional, default=0.95
      intended coverage of the prediction bands (0.0 to 1.0)
      If None, the upper/lower predictions are not returned by `predict`
  
      Every subclass must use `coverage` to set prediction band width. This ensures a common
      BaseForecastEstimator interface for parameters used during fitting and forecast evaluation
  
  null_model_params : dict with arguments passed to DummyRegressor, optional, default=None
      Dictionary keys must be in ("strategy", "constant", "quantile")
      Defines null model. model score is R2_null_model_score of model error relative to null model, evaluated by score_func
      If None, model score is score_func of the model itself
  
  Attributes
  ----------
  null_model : DummyEstimator
      null model used to measure model score
  time_col_ : str
      Name of input data time column
  value_col_ : str
      Name of input data value column
  last_predicted_X_ : `pandas.DataFrame` or None
      The ``X`` last passed to ``self.predict()``.
      Used to speed up predictions if the same ``X`` is passed repeatedly.
      Resets to None when ``self.fit()`` is called.
  cached_predictions_ : `pandas.DataFrame` or None
      The return value of the last call to ``self.predict()``.
      Used to speed up predictions if the same ``X`` is passed repeatedly.
      Resets to None when ``self.fit()`` is called.
class_docstr_tok: ["A","base","class","for","forecast","models",".","Fits","a","timeseries","and","predicts","future","values","Parameters","--","--","--","--","--","score_func",":","callable",",","optional",",","default=mean_squared_error","Function","to","calculate","model","R2_null_model_score","score",",","with","signature","(","actual",",","predicted",")",".","`","actual","`",",","`","predicted","`","are","array-like","with","the","same","shape",".","Smaller","values","are","better",".","coverage",":","float",",","optional",",","default=0.95","intended","coverage","of","the","prediction","bands","(","0.0","to","1.0",")","If","None",",","the","upper\/lower","predictions","are","not","returned","by","`","predict","`","Every","subclass","must","use","`","coverage","`","to","set","prediction","band","width",".","This","ensures","a","common","BaseForecastEstimator","interface","for","parameters","used","during","fitting","and","forecast","evaluation","null_model_params",":","dict","with","arguments","passed","to","DummyRegressor",",","optional",",","default=None","Dictionary","keys","must","be","in","(","``","strategy","''",",","``","constant","''",",","``","quantile","''",")","Defines","null","model",".","model","score","is","R2_null_model_score","of","model","error","relative","to","null","model",",","evaluated","by","score_func","If","None",",","model","score","is","score_func","of","the","model","itself","Attributes","--","--","--","--","--","null_model",":","DummyEstimator","null","model","used","to","measure","model","score","time_col_",":","str","Name","of","input","data","time","column","value_col_",":","str","Name","of","input","data","value","column","last_predicted_X_",":","`","pandas.DataFrame","`","or","None","The","``","X","``","last","passed","to","``","self.predict","(",")","``",".","Used","to","speed","up","predictions","if","the","same","``","X","``","is","passed","repeatedly",".","Resets","to","None","when","``","self.fit","(",")","``","is","called",".","cached_predictions_",":","`","pandas.DataFrame","`","or","None","The","return","value","of","the","last","call","to","``","self.predict","(",")","``",".","Used","to","speed","up","predictions","if","the","same","``","X","``","is","passed","repeatedly",".","Resets","to","None","when","``","self.fit","(",")","``","is","called","."]
docstr: Default scorer for the estimator (Used in GridSearchCV/RandomizedSearchCV if scoring=None)
  
  Notes
  -----
  If null_model_params is not None, returns R2_null_model_score of model error
  relative to null model, evaluated by score_func.
  
  If null_model_params is None, returns score_func of the model itself.
  
  By default, grid search (with no `scoring` parameter) optimizes improvement of ``score_func``
  against null model.
  
  To optimize a different score function, pass `scoring` to GridSearchCV/RandomizedSearchCV.
  
  Parameters
  ----------
  X : `pandas.DataFrame`
      Input timeseries with timestamp column and any additional regressors.
      Value column, if provided in X, is ignored
  y : `pandas.Series` or  `numpy.array`
      Actual value, used to compute error
  sample_weight : `pandas.Series` or  `numpy.array`
      ignored
  
  Returns
  -------
  score : `float` or None
      Comparison of predictions against null predictions, according to specified score function
docstr_tok: ["Default","scorer","for","the","estimator","(","Used","in","GridSearchCV\/RandomizedSearchCV","if","scoring=None",")","Notes","--","--","-","If","null_model_params","is","not","None",",","returns","R2_null_model_score","of","model","error","relative","to","null","model",",","evaluated","by","score_func",".","If","null_model_params","is","None",",","returns","score_func","of","the","model","itself",".","By","default",",","grid","search","(","with","no","`","scoring","`","parameter",")","optimizes","improvement","of","``","score_func","``","against","null","model",".","To","optimize","a","different","score","function",",","pass","`","scoring","`","to","GridSearchCV\/RandomizedSearchCV",".","Parameters","--","--","--","--","--","X",":","`","pandas.DataFrame","`","Input","timeseries","with","timestamp","column","and","any","additional","regressors",".","Value","column",",","if","provided","in","X",",","is","ignored","y",":","`","pandas.Series","`","or","`","numpy.array","`","Actual","value",",","used","to","compute","error","sample_weight",":","`","pandas.Series","`","or","`","numpy.array","`","ignored","Returns","--","--","--","-","score",":","`","float","`","or","None","Comparison","of","predictions","against","null","predictions",",","according","to","specified","score","function"]
code: def score(self, X, y, sample_weight=None):
      """Default scorer for the estimator (Used in GridSearchCV/RandomizedSearchCV if scoring=None)
  
      Notes
      -----
      If null_model_params is not None, returns R2_null_model_score of model error
      relative to null model, evaluated by score_func.
  
      If null_model_params is None, returns score_func of the model itself.
  
      By default, grid search (with no `scoring` parameter) optimizes improvement of ``score_func``
      against null model.
  
      To optimize a different score function, pass `scoring` to GridSearchCV/RandomizedSearchCV.
  
      Parameters
      ----------
      X : `pandas.DataFrame`
          Input timeseries with timestamp column and any additional regressors.
          Value column, if provided in X, is ignored
      y : `pandas.Series` or  `numpy.array`
          Actual value, used to compute error
      sample_weight : `pandas.Series` or  `numpy.array`
          ignored
  
      Returns
      -------
      score : `float` or None
          Comparison of predictions against null predictions, according to specified score function
      """
      y_pred = self.predict(X)[cst.PREDICTED_COL]
      if self.null_model is not None:
          y_pred_null = self.null_model.predict(X)[cst.PREDICTED_COL]
          score = r2_null_model_score(
              y,
              y_pred,
              y_pred_null=y_pred_null,
              loss_func=self.score_func,
          )
      else:
          score = self.score_func(y, y_pred)
      return score
  
imports: from abc import ABC
  from abc import abstractmethod
  from typing import Optional
  import pandas
  from sklearn.base import BaseEstimator
  from sklearn.base import RegressorMixin
  from sklearn.metrics import mean_squared_error
  from greykite.common import constants
  from greykite.common.evaluation import r2_null_model_score
  from greykite.common.logging import LoggingLevelEnum
  from greykite.common.logging import log_message
  from greykite.sklearn.estimator.null_model import DummyEstimator
  from greykite.sklearn.uncertainty.exceptions import UncertaintyError
  from greykite.sklearn.uncertainty.uncertainty_methods import UncertaintyMethodEnum
label_desc: Use image node_id 5 for calling the BaseForecastEstimator obj's underlying member method code with example usage: obj.score(X, y, sample_weight) and returns: score