code: def buildModelMetricsCheck(train_data, family, bs):
      x = []
      y = "response"
      if not (family == "gaussian"):
          train_data[y] = train_data[y].asfactor()
      frames = train_data.split_frame(ratios=[0.9], seed=12345)
  
      h2o_model = H2OGeneralizedAdditiveEstimator(
          family=family, gam_columns=["C1"], seed=12345, bs=bs
      )
      h2o_model.train(
          x=x, y=y, training_frame=frames[0], validation_frame=frames[1]
      )
  
      h2o_model2 = H2OGeneralizedAdditiveEstimator(
          family=family, gam_columns=["C1"], seed=12345, bs=bs
      )
      h2o_model2.train(
          x=x, y=y, training_frame=frames[0], validation_frame=frames[1]
      )
  
      # check and make sure coefficient does not contain predictor column
      coeffNames = h2o_model.coef().keys()
      assert (
          not "C1" in coeffNames
      ), "Not expecting C1 to be a coefficient but it is."
  
      # check and make sure both model produce the same metrics
      if family == "gaussian":
          assert (
              h2o_model.mse() == h2o_model2.mse()
          ), "Expected model MSE: {0}, Actual: {1}".format(
              h2o_model.mse(), h2o_model2.mse()
          )
      else:
          assert (
              h2o_model.logloss() == h2o_model2.logloss()
          ), "Expected model logloss: {0}, Actual: " "{1}".format(
              h2o_model.logloss(), h2o_model2.logloss()
          )
  
imports: import sys
  import h2o
  from tests import pyunit_utils
  from h2o.estimators.gam import H2OGeneralizedAdditiveEstimator
label_desc: Use image node_id 2 for calling a global function with example usage: buildModelMetricsCheck(train_data, family, bs) without return types