class_docstr: Simple estimator that predicts a constant (the weekday of the first date in
  ``X`` passed to ``predict``).
  Used to test BaseForecastEstimator methods, since abstract classes can't be instantiated.
class_docstr_tok: ["Simple","estimator","that","predicts","a","constant","(","the","weekday","of","the","first","date","in","``","X","``","passed","to","``","predict","``",")",".","Used","to","test","BaseForecastEstimator","methods",",","since","abstract","classes","ca","n't","be","instantiated","."]
code: def predict(self, X, y=None):
      cached_predictions = super().predict(X=X)
      if cached_predictions is not None:
          return cached_predictions
  
      # For testing purposes, always predicts the weekday of the first date in X
      cst_pred = float(X[self.time_col_].iloc[0].weekday())
      predictions = pd.DataFrame(
          {
              TIME_COL: X[self.time_col_],
              PREDICTED_COL: np.repeat(cst_pred, X.shape[0]),
          }
      )
      self.cached_predictions_ = predictions
      return predictions
  
imports: import numpy
  import pandas
  import pytest
  from pandas.testing import assert_frame_equal
  from sklearn.metrics import mean_absolute_error
  from sklearn.metrics import mean_squared_error
  from testfixtures import LogCapture
  from greykite.common.constants import LOGGER_NAME
  from greykite.common.constants import PREDICTED_COL
  from greykite.common.constants import PREDICTED_LOWER_COL
  from greykite.common.constants import PREDICTED_UPPER_COL
  from greykite.common.constants import TIME_COL
  from greykite.common.constants import VALUE_COL
  from greykite.common.evaluation import r2_null_model_score
  from greykite.sklearn.estimator.base_forecast_estimator import BaseForecastEstimator
  from greykite.sklearn.uncertainty.uncertainty_methods import UncertaintyMethodEnum
label_desc: Use image node_id 3 for calling the ConstantBaseForecastEstimator obj's underlying member method code with example usage: obj.predict(X, y) and returns: predictions, cached_predictions