code: def test_early_stopping_and_cross_validation_correctly_set_actual_params():
      prostate = h2o.import_file(
          pyunit_utils.locate("smalldata/prostate/prostate.csv")
      )
      response = "CAPSULE"
      ntrees = 100
      prostate[response] = prostate[response].asfactor()
      train, valid = prostate.split_frame(ratios=[0.8], seed=1234)
  
      rf = H2ORandomForestEstimator(
          ntrees=ntrees,
          max_depth=8,
          nfolds=2,
          stopping_metric="auc",
          stopping_rounds=3,
          stopping_tolerance=0.01,
          seed=1,
          score_each_iteration=True,
      )
      build_model_and_check(rf, train, valid, response, ntrees)
      rf = H2ORandomForestEstimator(
          ntrees=ntrees,
          max_depth=8,
          nfolds=0,
          stopping_metric="auc",
          stopping_rounds=3,
          stopping_tolerance=0.01,
          seed=1,
          score_each_iteration=True,
      )
      build_model_and_check(rf, train, valid, response, ntrees)
  
      gbm = H2OGradientBoostingEstimator(
          ntrees=ntrees,
          max_depth=8,
          nfolds=2,
          stopping_metric="auc",
          stopping_rounds=3,
          stopping_tolerance=0.01,
          seed=1,
          score_each_iteration=True,
      )
      build_model_and_check(gbm, train, valid, response, ntrees)
      gbm = H2OGradientBoostingEstimator(
          ntrees=ntrees,
          max_depth=8,
          nfolds=0,
          stopping_metric="auc",
          stopping_rounds=3,
          stopping_tolerance=0.01,
          seed=1,
          score_each_iteration=True,
      )
      build_model_and_check(gbm, train, valid, response, ntrees)
  
      isofor = H2OIsolationForestEstimator(
          ntrees=ntrees,
          max_depth=8,
          stopping_metric="AUCPR",
          stopping_rounds=3,
          stopping_tolerance=0.01,
          seed=1,
          validation_frame=valid,
          validation_response_column=response,
          score_each_iteration=True,
      )
      build_model_and_check(isofor, train, valid, response, ntrees)
  
      xgb = H2OXGBoostEstimator(
          ntrees=ntrees,
          max_depth=8,
          nfolds=2,
          stopping_metric="auc",
          stopping_rounds=3,
          stopping_tolerance=0.01,
          seed=1,
          score_each_iteration=True,
      )
      build_model_and_check(xgb, train, valid, response, ntrees)
      xgb = H2OXGBoostEstimator(
          ntrees=ntrees,
          max_depth=8,
          nfolds=0,
          stopping_metric="auc",
          stopping_rounds=3,
          stopping_tolerance=0.01,
          seed=1,
          score_each_iteration=True,
      )
      build_model_and_check(xgb, train, valid, response, ntrees)
  
imports: import sys
  import h2o
  import os
  from tests import pyunit_utils, assert_equals
  from h2o.estimators import H2ORandomForestEstimator, H2OGradientBoostingEstimator, H2OIsolationForestEstimator, H2OXGBoostEstimator
label_desc: Use image node_id 2 for calling a global function with example usage: test_early_stopping_and_cross_validation_correctly_set_actual_params() without return types