code: def basic_inference_works_for_DRF_and_NB_test():
      train = h2o.import_file(
          pyunit_utils.locate("smalldata/iris/iris_train.csv")
      )
      test = h2o.import_file(
          pyunit_utils.locate("smalldata/iris/iris_test.csv")
      )
  
      x_class = train.columns
      y_class = "species"
      x_class.remove(y_class)
  
      nfolds = 2
  
      nb_class = H2ONaiveBayesEstimator(
          nfolds=nfolds,
          fold_assignment="Modulo",
          keep_cross_validation_predictions=True,
      )
      nb_class.train(x=x_class, y=y_class, training_frame=train)
  
      gbm_class = H2OGradientBoostingEstimator(
          nfolds=nfolds,
          fold_assignment="Modulo",
          keep_cross_validation_predictions=True,
      )
      gbm_class.train(x=x_class, y=y_class, training_frame=train)
  
      drf_class = H2ORandomForestEstimator(
          nfolds=nfolds,
          fold_assignment="Modulo",
          keep_cross_validation_predictions=True,
      )
      drf_class.train(x=x_class, y=y_class, training_frame=train)
  
      se_class_0 = H2OStackedEnsembleEstimator(
          training_frame=train,
          validation_frame=test,
          base_models=[nb_class, gbm_class, drf_class],
          metalearner_algorithm="gbm",
      )
      se_class_0.train(x_class, y_class, train)
  
      assert (
          se_class_0.metalearner().actual_params.get("distribution")
          == "multinomial"
      ), "Expected distribution {} but got {}".format(
          "multinomial",
          se_class_0.metalearner().actual_params.get("distribution"),
      )
  
      se_class_1 = H2OStackedEnsembleEstimator(
          training_frame=train,
          validation_frame=test,
          base_models=[gbm_class, drf_class, nb_class],
          metalearner_algorithm="gbm",
      )
      se_class_1.train(x_class, y_class, train)
  
      assert (
          se_class_1.metalearner().actual_params.get("distribution")
          == "multinomial"
      ), "Expected distribution {} but got {}".format(
          "multinomial",
          se_class_1.metalearner().actual_params.get("distribution"),
      )
  
      se_class_2 = H2OStackedEnsembleEstimator(
          training_frame=train,
          validation_frame=test,
          base_models=[drf_class, nb_class, gbm_class],
          metalearner_algorithm="gbm",
      )
      se_class_2.train(x_class, y_class, train)
  
      assert (
          se_class_2.metalearner().actual_params.get("distribution")
          == "multinomial"
      ), "Expected distribution {} but got {}".format(
          "multinomial",
          se_class_2.metalearner().actual_params.get("distribution"),
      )
  
      se_class_3 = H2OStackedEnsembleEstimator(
          training_frame=train,
          validation_frame=test,
          base_models=[nb_class, gbm_class, drf_class],
      )
      se_class_3.train(x_class, y_class, train)
  
      assert (
          se_class_3.metalearner().actual_params.get("family")
          == "multinomial"
      ), "Expected family {} but got {}".format(
          "multinomial",
          se_class_3.metalearner().actual_params.get("family"),
      )
  
      se_class_4 = H2OStackedEnsembleEstimator(
          training_frame=train,
          validation_frame=test,
          base_models=[gbm_class, drf_class, nb_class],
      )
      se_class_4.train(x_class, y_class, train)
  
      assert (
          se_class_4.metalearner().actual_params.get("family")
          == "multinomial"
      ), "Expected family {} but got {}".format(
          "multinomial",
          se_class_4.metalearner().actual_params.get("family"),
      )
  
      se_class_5 = H2OStackedEnsembleEstimator(
          training_frame=train,
          validation_frame=test,
          base_models=[drf_class, nb_class, gbm_class],
      )
      se_class_5.train(x_class, y_class, train)
  
      assert (
          se_class_5.metalearner().actual_params.get("family")
          == "multinomial"
      ), "Expected family {} but got {}".format(
          "multinomial",
          se_class_5.metalearner().actual_params.get("family"),
      )
  
file_path: h2o-3/h2o-py/tests/testdir_algos/stackedensemble/pyunit_stackedensemble_distributions.py
imports: import sys
  import h2o
  from h2o.estimators.random_forest import H2ORandomForestEstimator
  from h2o.estimators.glm import H2OGeneralizedLinearEstimator
  from h2o.estimators.gbm import H2OGradientBoostingEstimator
  from h2o.estimators.stackedensemble import H2OStackedEnsembleEstimator
  from h2o.estimators.naive_bayes import H2ONaiveBayesEstimator
  from tests import pyunit_utils
label_desc: Use image node_id 9 for calling a global function with example usage: basic_inference_works_for_DRF_and_NB_test() without return types