Ejemplo n.º 1
0
 def categorical_encoding(self, categorical_encoding):
     assert_is_type(categorical_encoding, None, Enum("auto", "enum", "one_hot_internal", "one_hot_explicit", "binary", "eigen", "label_encoder", "sort_by_response", "enum_limited"))
     self._parms["categorical_encoding"] = categorical_encoding
Ejemplo n.º 2
0
 def setDistribution(self, value):
     assert_is_type(value, None, Enum("AUTO", "bernoulli", "multinomial", "gaussian", "poisson", "gamma", "tweedie", "laplace", "quantile", "huber"))
     jvm = H2OContext.getOrCreate(SparkSession.builder.getOrCreate(), verbose=False)._jvm
     correct_case_value = get_correct_case_enum(jvm.hex.genmodel.utils.DistributionFamily.values(), value)
     return self._set(distribution=jvm.hex.genmodel.utils.DistributionFamily.valueOf(correct_case_value))
Ejemplo n.º 3
0
 def setStoppingMetric(self, value):
     # H2O typechecks does not check for case sensitivity
     assert_is_type(value, Enum("AUTO", "deviance", "logloss", "MSE", "RMSE", "MAE", "RMSLE", "AUC", "lift_top_group", "misclassification", "mean_per_class_error", "custom"))
     jvm = H2OContext.getOrCreate(SparkSession.builder.getOrCreate(), verbose=False)._jvm
     correct_case_value = get_correct_case_enum(jvm.hex.ScoreKeeper.StoppingMetric.values(), value)
     return self._set(stoppingMetric=jvm.hex.ScoreKeeper.StoppingMetric.valueOf(correct_case_value))
Ejemplo n.º 4
0
 def kernel_type(self, kernel_type):
     assert_is_type(kernel_type, None, Enum("gaussian"))
     self._parms["kernel_type"] = kernel_type
Ejemplo n.º 5
0
 def init(self, init):
     assert_is_type(init, None,
                    Enum("random", "plus_plus", "furthest", "user"))
     self._parms["init"] = init
Ejemplo n.º 6
0
 def loss_by_col(self, loss_by_col):
     assert_is_type(loss_by_col, None, [
         Enum("quadratic", "absolute", "huber", "poisson", "hinge",
              "logistic", "periodic", "categorical", "ordinal")
     ])
     self._parms["loss_by_col"] = loss_by_col
Ejemplo n.º 7
0
 def regularization_y(self, regularization_y):
     assert_is_type(
         regularization_y, None,
         Enum("none", "quadratic", "l2", "l1", "non_negative", "one_sparse",
              "unit_one_sparse", "simplex"))
     self._parms["regularization_y"] = regularization_y
Ejemplo n.º 8
0
 def histogram_type(self, histogram_type):
     assert_is_type(
         histogram_type, None,
         Enum("auto", "uniform_adaptive", "random", "quantiles_global",
              "round_robin"))
     self._parms["histogram_type"] = histogram_type
Ejemplo n.º 9
0
 def distribution(self, distribution):
     assert_is_type(
         distribution, None,
         Enum("auto", "bernoulli", "multinomial", "gaussian", "poisson",
              "gamma", "tweedie", "laplace", "quantile", "huber"))
     self._parms["distribution"] = distribution
Ejemplo n.º 10
0
 def metalearner_fold_assignment(self, metalearner_fold_assignment):
     assert_is_type(metalearner_fold_assignment, None,
                    Enum("auto", "random", "modulo", "stratified"))
     self._parms[
         "metalearner_fold_assignment"] = metalearner_fold_assignment
Ejemplo n.º 11
0
 def selection_strategy(self, selection_strategy):
     assert_is_type(selection_strategy, None, Enum("choose_all"))
     self._parms["selection_strategy"] = selection_strategy
Ejemplo n.º 12
0
 def metalearner_algorithm(self, metalearner_algorithm):
     assert_is_type(metalearner_algorithm, None,
                    Enum("auto", "glm", "gbm", "drf", "deeplearning"))
     self._parms["metalearner_algorithm"] = metalearner_algorithm
Ejemplo n.º 13
0
 def auuc_type(self, auuc_type):
     assert_is_type(auuc_type, None, Enum("auto", "qini", "lift", "gain"))
     self._parms["auuc_type"] = auuc_type
Ejemplo n.º 14
0
 def uplift_metric(self, uplift_metric):
     assert_is_type(uplift_metric, None, Enum("auto", "kl", "euclidean", "chi_squared"))
     self._parms["uplift_metric"] = uplift_metric
Ejemplo n.º 15
0
 def transform(self, transform):
     assert_is_type(
         transform, None,
         Enum("none", "standardize", "normalize", "demean", "descale"))
     self._parms["transform"] = transform
Ejemplo n.º 16
0
 def sample_type(self, sample_type):
     assert_is_type(sample_type, None, Enum("uniform", "weighted"))
     self._parms["sample_type"] = sample_type
Ejemplo n.º 17
0
 def loss(self, loss):
     assert_is_type(
         loss, None,
         Enum("quadratic", "absolute", "huber", "poisson", "hinge",
              "logistic", "periodic"))
     self._parms["loss"] = loss
Ejemplo n.º 18
0
 def normalize_type(self, normalize_type):
     assert_is_type(normalize_type, None, Enum("tree", "forest"))
     self._parms["normalize_type"] = normalize_type
Ejemplo n.º 19
0
 def multi_loss(self, multi_loss):
     assert_is_type(multi_loss, None, Enum("categorical", "ordinal"))
     self._parms["multi_loss"] = multi_loss
Ejemplo n.º 20
0
 def tree_method(self, tree_method):
     assert_is_type(tree_method, None,
                    Enum("auto", "exact", "approx", "hist"))
     self._parms["tree_method"] = tree_method
Ejemplo n.º 21
0
 def svd_method(self, svd_method):
     assert_is_type(svd_method, None,
                    Enum("gram_s_v_d", "power", "randomized"))
     self._parms["svd_method"] = svd_method
Ejemplo n.º 22
0
 def grow_policy(self, grow_policy):
     assert_is_type(grow_policy, None, Enum("depthwise", "lossguide"))
     self._parms["grow_policy"] = grow_policy
Ejemplo n.º 23
0
 def fold_assignment(self, fold_assignment):
     assert_is_type(fold_assignment, None,
                    Enum("auto", "random", "modulo", "stratified"))
     self._parms["fold_assignment"] = fold_assignment
Ejemplo n.º 24
0
 def booster(self, booster):
     assert_is_type(booster, None, Enum("gbtree", "gblinear", "dart"))
     self._parms["booster"] = booster
Ejemplo n.º 25
0
 def categorical_encoding(self, categorical_encoding):
     assert_is_type(
         categorical_encoding, None,
         Enum("auto", "enum", "one_hot_internal", "one_hot_explicit",
              "binary", "eigen"))
     self._parms["categorical_encoding"] = categorical_encoding
Ejemplo n.º 26
0
 def dmatrix_type(self, dmatrix_type):
     assert_is_type(dmatrix_type, None, Enum("auto", "dense", "sparse"))
     self._parms["dmatrix_type"] = dmatrix_type
Ejemplo n.º 27
0
 def setHistogramType(self, value):
     assert_is_type(value, None, Enum("AUTO", "UniformAdaptive", "Random", "QuantilesGlobal", "RoundRobin"))
     jvm = H2OContext.getOrCreate(SparkSession.builder.getOrCreate(), verbose=False)._jvm
     correct_case_value = get_correct_case_enum(jvm.hex.tree.SharedTreeModel.SharedTreeParameters.HistogramType.values(), value)
     return self._set(histogramType=jvm.hex.tree.SharedTreeModel.SharedTreeParameters.HistogramType.valueOf(correct_case_value))
Ejemplo n.º 28
0
 def backend(self, backend):
     assert_is_type(backend, None, Enum("auto", "gpu", "cpu"))
     self._parms["backend"] = backend
Ejemplo n.º 29
0
 def stopping_metric(self, stopping_metric):
     assert_is_type(stopping_metric, None, Enum("auto", "anomaly_score"))
     self._parms["stopping_metric"] = stopping_metric
Ejemplo n.º 30
0
 def download_h2o_logs(self, destination, container="ZIP"):
     assert_is_type(container, Enum("ZIP", "LOG"))
     return self._jhc.h2oContext().downloadH2OLogs(destination, container)