code: def cv_nfolds_gbm():
      prostate = h2o.import_file(
          path=pyunit_utils.locate("smalldata/logreg/prostate.csv")
      )
      prostate[1] = prostate[1].asfactor()
      prostate.summary()
  
      prostate_gbm = H2OGradientBoostingEstimator(
          nfolds=5, distribution="bernoulli"
      )
      prostate_gbm.train(
          x=list(range(2, 9)), y=1, training_frame=prostate
      )
      prostate_gbm.show()
  
      print(prostate_gbm.model_performance(xval=True))
  
      # Can specify both nfolds >= 2 and validation data at once
      try:
          H2OGradientBoostingEstimator(
              nfolds=5, distribution="bernoulli"
          ).train(
              x=list(range(2, 9)),
              y=1,
              training_frame=prostate,
              validation_frame=prostate,
          )
  
          assert True
      except EnvironmentError:
          assert False, "expected an error"
  
imports: from builtins import range
  import sys
  import h2o
  from tests import pyunit_utils
  from h2o.estimators.gbm import H2OGradientBoostingEstimator
label_desc: Use image node_id 1 for calling a global function with example usage: cv_nfolds_gbm() without return types