code: def test_fit_predict(params, X_custom):
      """Tests model fit and predict with custom column names"""
      model = ConstantBaseForecastEstimator(**params)
      assert model.last_predicted_X_ is None
      assert model.cached_predictions_ is None
      model.fit(X_custom, time_col="time_name", value_col="value_name")
      assert model.time_col_ == "time_name"
      assert model.value_col_ == "value_name"
  
      # Checks model predictions
      with LogCapture(LOGGER_NAME) as log_capture:
          predicted = model.predict(X_custom)
          cst_pred = float(X_custom[model.time_col_].iloc[0].weekday())
          expected = pd.DataFrame(
              {
                  TIME_COL: X_custom["time_name"],
                  PREDICTED_COL: np.repeat(cst_pred, X_custom.shape[0]),
              }
          )
          assert_frame_equal(predicted, expected)
          assert model.last_predicted_X_ is not None
          assert model.cached_predictions_ is not None
          assert_frame_equal(model.last_predicted_X_, X_custom)
          assert_frame_equal(model.cached_predictions_, expected)
          log_capture.check()  # no log messages (not using cached predictions)
  
      # Uses cached predictions
      with LogCapture(LOGGER_NAME) as log_capture:
          model.predict(X_custom)
          log_capture.check(
              (LOGGER_NAME, "DEBUG", "Returning cached predictions.")
          )
  
      # Predicts on a different dataset
      with LogCapture(LOGGER_NAME) as log_capture:
          X_new = X_custom.iloc[1:].copy()
          predicted = model.predict(X_new)
          log_capture.check()  # no log messages (not using cached predictions)
          cst_pred = float(X_new[model.time_col_].iloc[0].weekday())
          expected = pd.DataFrame(
              {
                  TIME_COL: X_new["time_name"],
                  PREDICTED_COL: np.repeat(cst_pred, X_new.shape[0]),
              }
          )
          assert_frame_equal(predicted, expected)
          assert_frame_equal(model.last_predicted_X_, X_new)
          assert_frame_equal(model.cached_predictions_, expected)
  
      # .fit() clears the cached result
      model.fit(X_custom, time_col="time_name", value_col="value_name")
      assert model.last_predicted_X_ is None
      assert model.cached_predictions_ is None
  
      # Checks null model predictions
      null_predicted = model.null_model.predict(X_custom)
      null_expected = pd.DataFrame(
          {
              TIME_COL: X_custom["time_name"],
              PREDICTED_COL: np.repeat(8.0, X_custom.shape[0]),
          }
      )
      assert null_predicted.equals(null_expected)
  
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 6 for calling a global function with example usage: test_fit_predict(params, X_custom) without return types