class_docstr: Stacked Ensemble
  
  Builds a stacked ensemble (aka "super learner") machine learning method that uses two
  or more H2O learning algorithms to improve predictive performance. It is a loss-based
  supervised learning method that finds the optimal combination of a collection of prediction
  algorithms.This method supports regression and binary classification.
  
  :examples:
  
  >>> import h2o
  >>> h2o.init()
  >>> from h2o.estimators.random_forest import H2ORandomForestEstimator
  >>> from h2o.estimators.gbm import H2OGradientBoostingEstimator
  >>> from h2o.estimators.stackedensemble import H2OStackedEnsembleEstimator
  >>> col_types = ["numeric", "numeric", "numeric", "enum",
  ...              "enum", "numeric", "numeric", "numeric", "numeric"]
  >>> data = h2o.import_file("http://h2o-public-test-data.s3.amazonaws.com/smalldata/prostate/prostate.csv", col_types=col_types)
  >>> train, test = data.split_frame(ratios=[.8], seed=1)
  >>> x = ["CAPSULE","GLEASON","RACE","DPROS","DCAPS","PSA","VOL"]
  >>> y = "AGE"
  >>> nfolds = 5
  >>> gbm = H2OGradientBoostingEstimator(nfolds=nfolds,
  ...                                    fold_assignment="Modulo",
  ...                                    keep_cross_validation_predictions=True)
  >>> gbm.train(x=x, y=y, training_frame=train)
  >>> rf = H2ORandomForestEstimator(nfolds=nfolds,
  ...                               fold_assignment="Modulo",
  ...                               keep_cross_validation_predictions=True)
  >>> rf.train(x=x, y=y, training_frame=train)
  >>> stack = H2OStackedEnsembleEstimator(model_id="ensemble",
  ...                                     training_frame=train,
  ...                                     validation_frame=test,
  ...                                     base_models=[gbm.model_id, rf.model_id])
  >>> stack.train(x=x, y=y, training_frame=train, validation_frame=test)
  >>> stack.model_performance()
class_docstr_tok: ["Stacked","Ensemble","Builds","a","stacked","ensemble","(","aka","``","super","learner","''",")","machine","learning","method","that","uses","two","or","more","H2O","learning","algorithms","to","improve","predictive","performance",".","It","is","a","loss-based","supervised","learning","method","that","finds","the","optimal","combination","of","a","collection","of","prediction","algorithms.This","method","supports","regression","and","binary","classification",".",":","examples",":",">",">",">","import","h2o",">",">",">","h2o.init","(",")",">",">",">","from","h2o.estimators.random_forest","import","H2ORandomForestEstimator",">",">",">","from","h2o.estimators.gbm","import","H2OGradientBoostingEstimator",">",">",">","from","h2o.estimators.stackedensemble","import","H2OStackedEnsembleEstimator",">",">",">","col_types","=","[","``","numeric","''",",","``","numeric","''",",","``","numeric","''",",","``","enum","''",",","...","``","enum","''",",","``","numeric","''",",","``","numeric","''",",","``","numeric","''",",","``","numeric","''","]",">",">",">","data","=","h2o.import_file","(","``","http",":","\/\/h2o-public-test-data.s3.amazonaws.com\/smalldata\/prostate\/prostate.csv","''",",","col_types=col_types",")",">",">",">","train",",","test","=","data.split_frame","(","ratios=","[",".8","]",",","seed=1",")",">",">",">","x","=","[","``","CAPSULE","''",",","''","GLEASON","''",",","''","RACE","''",",","''","DPROS","''",",","''","DCAPS","''",",","''","PSA","''",",","''","VOL","''","]",">",">",">","y","=","``","AGE","''",">",">",">","nfolds","=","5",">",">",">","gbm","=","H2OGradientBoostingEstimator","(","nfolds=nfolds",",","...","fold_assignment=","''","Modulo","''",",","...","keep_cross_validation_predictions=True",")",">",">",">","gbm.train","(","x=x",",","y=y",",","training_frame=train",")",">",">",">","rf","=","H2ORandomForestEstimator","(","nfolds=nfolds",",","...","fold_assignment=","''","Modulo","''",",","...","keep_cross_validation_predictions=True",")",">",">",">","rf.train","(","x=x",",","y=y",",","training_frame=train",")",">",">",">","stack","=","H2OStackedEnsembleEstimator","(","model_id=","''","ensemble","''",",","...","training_frame=train",",","...","validation_frame=test",",","...","base_models=","[","gbm.model_id",",","rf.model_id","]",")",">",">",">","stack.train","(","x=x",",","y=y",",","training_frame=train",",","validation_frame=test",")",">",">",">","stack.model_performance","(",")"]
code: def metalearner_algorithm(self, metalearner_algorithm):
      assert_is_type(
          metalearner_algorithm,
          None,
          Enum(
              "auto",
              "deeplearning",
              "drf",
              "gbm",
              "glm",
              "naivebayes",
              "xgboost",
          ),
      )
      self._parms["metalearner_algorithm"] = metalearner_algorithm
  
imports: import ast
  import json
  import warnings
  import h2o
  from h2o.base import Keyed
  from h2o.exceptions import H2OResponseError, H2ODeprecationWarning
  from h2o.grid import H2OGridSearch
  from h2o.job import H2OJob
  from h2o.utils.shared_utils import quoted
  from h2o.utils.typechecks import is_type
  from h2o.estimators.estimator_base import H2OEstimator
  from h2o.exceptions import H2OValueError
  from h2o.frame import H2OFrame
  from h2o.utils.typechecks import assert_is_type, Enum, numeric
label_desc: Use image node_id 13 for calling the H2OStackedEnsembleEstimator obj's underlying member method code with example usage: obj.metalearner_algorithm(metalearner_algorithm) without return types