code: def test_fit_ml_model_with_evaluation_constant_column():
      """Tests ``fit_ml_model_with_evaluation``
      when some regressors are constant"""
      res = generate_test_data_for_fitting(n=80)
      df = res["df"]
      y_test = res["y_test"]
      df_test = res["df_test"]
      y_col = "y"
  
      # add constant columns
      new_cols = []
      for i in range(300):
          col = f"cst{i}"
          df[col] = 0
          df_test[col] = 2
          new_cols.append(col)
      df["cst_event"] = "string"
      df_test["cst_event"] = "string"
      new_cols.append("cst_event")
  
      model_formula_str = "+".join(
          [res["model_formula_str"]] + new_cols
      )
  
      fit_algorithm = "linear"
      trained_model = fit_ml_model_with_evaluation(
          df=df,
          model_formula_str=model_formula_str,
          fit_algorithm=fit_algorithm,
          normalize_method="zero_to_one",
      )
  
      pred_res = predict_ml(fut_df=df_test, trained_model=trained_model)
      fut_df = pred_res["fut_df"]
      y_test_pred = fut_df[y_col]
  
      # intercept, x1, x2, x3, x4, [constant columns]
      expected_values = [-23.0, 1.0, 4.0, 0.0, 44.0, 0.0, 0.0]
      assert (
          list(pd.Series(trained_model["ml_model"].coef_)[:7].round())
          == expected_values
      )
  
      err = calc_pred_err(y_test, y_test_pred)
      enum = EvaluationMetricEnum.MeanAbsoluteError
      assert err[enum.get_metric_name()] < 3.0
      enum = EvaluationMetricEnum.RootMeanSquaredError
      assert err[enum.get_metric_name()] < 3.0
      enum = EvaluationMetricEnum.Correlation
      assert err[enum.get_metric_name()] > 0.5
  
      # testing actual values for a smaller set
      y_test_pred = predict_ml(
          fut_df=df_test[:10], trained_model=trained_model
      )["fut_df"][y_col]
      expected_values = [
          18.0,
          19.0,
          16.0,
          13.0,
          9.0,
          1.0,
          23.0,
          14.0,
          12.0,
          14.0,
      ]
      assert list(y_test_pred.round()) == expected_values
  
imports: import warnings
  import numpy
  import pandas
  import pytest
  import scipy
  from pandas.testing import assert_frame_equal
  from patsy import dmatrices
  from greykite.algo.common.ml_models import breakdown_regression_based_prediction
  from greykite.algo.common.ml_models import design_mat_from_formula
  from greykite.algo.common.ml_models import fit_ml_model
  from greykite.algo.common.ml_models import fit_ml_model_with_evaluation
  from greykite.algo.common.ml_models import fit_model_via_design_matrix
  from greykite.algo.common.ml_models import get_h_mat
  from greykite.algo.common.ml_models import get_intercept_col_from_design_mat
  from greykite.algo.common.ml_models import predict_ml
  from greykite.algo.common.ml_models import predict_ml_with_uncertainty
  from greykite.algo.uncertainty.conditional.conf_interval import predict_ci
  from greykite.common.constants import ERR_STD_COL
  from greykite.common.constants import QUANTILE_SUMMARY_COL
  from greykite.common.constants import TimeFeaturesEnum
  from greykite.common.evaluation import EvaluationMetricEnum
  from greykite.common.evaluation import calc_pred_err
  from greykite.common.features.timeseries_features import build_time_features_df
  from greykite.common.features.timeseries_features import fourier_series_multi_fcn
  from greykite.common.features.timeseries_features import get_fourier_col_name
  from greykite.common.python_utils import assert_equal
  from greykite.common.testing_utils import gen_sliced_df
label_desc: Use image node_id 32 for calling a global function with example usage: test_fit_ml_model_with_evaluation_constant_column() without return types