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
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))
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))
def kernel_type(self, kernel_type): assert_is_type(kernel_type, None, Enum("gaussian")) self._parms["kernel_type"] = kernel_type
def init(self, init): assert_is_type(init, None, Enum("random", "plus_plus", "furthest", "user")) self._parms["init"] = init
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
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
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
def distribution(self, distribution): assert_is_type( distribution, None, Enum("auto", "bernoulli", "multinomial", "gaussian", "poisson", "gamma", "tweedie", "laplace", "quantile", "huber")) self._parms["distribution"] = distribution
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
def selection_strategy(self, selection_strategy): assert_is_type(selection_strategy, None, Enum("choose_all")) self._parms["selection_strategy"] = selection_strategy
def metalearner_algorithm(self, metalearner_algorithm): assert_is_type(metalearner_algorithm, None, Enum("auto", "glm", "gbm", "drf", "deeplearning")) self._parms["metalearner_algorithm"] = metalearner_algorithm
def auuc_type(self, auuc_type): assert_is_type(auuc_type, None, Enum("auto", "qini", "lift", "gain")) self._parms["auuc_type"] = auuc_type
def uplift_metric(self, uplift_metric): assert_is_type(uplift_metric, None, Enum("auto", "kl", "euclidean", "chi_squared")) self._parms["uplift_metric"] = uplift_metric
def transform(self, transform): assert_is_type( transform, None, Enum("none", "standardize", "normalize", "demean", "descale")) self._parms["transform"] = transform
def sample_type(self, sample_type): assert_is_type(sample_type, None, Enum("uniform", "weighted")) self._parms["sample_type"] = sample_type
def loss(self, loss): assert_is_type( loss, None, Enum("quadratic", "absolute", "huber", "poisson", "hinge", "logistic", "periodic")) self._parms["loss"] = loss
def normalize_type(self, normalize_type): assert_is_type(normalize_type, None, Enum("tree", "forest")) self._parms["normalize_type"] = normalize_type
def multi_loss(self, multi_loss): assert_is_type(multi_loss, None, Enum("categorical", "ordinal")) self._parms["multi_loss"] = multi_loss
def tree_method(self, tree_method): assert_is_type(tree_method, None, Enum("auto", "exact", "approx", "hist")) self._parms["tree_method"] = tree_method
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
def grow_policy(self, grow_policy): assert_is_type(grow_policy, None, Enum("depthwise", "lossguide")) self._parms["grow_policy"] = grow_policy
def fold_assignment(self, fold_assignment): assert_is_type(fold_assignment, None, Enum("auto", "random", "modulo", "stratified")) self._parms["fold_assignment"] = fold_assignment
def booster(self, booster): assert_is_type(booster, None, Enum("gbtree", "gblinear", "dart")) self._parms["booster"] = booster
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
def dmatrix_type(self, dmatrix_type): assert_is_type(dmatrix_type, None, Enum("auto", "dense", "sparse")) self._parms["dmatrix_type"] = dmatrix_type
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))
def backend(self, backend): assert_is_type(backend, None, Enum("auto", "gpu", "cpu")) self._parms["backend"] = backend
def stopping_metric(self, stopping_metric): assert_is_type(stopping_metric, None, Enum("auto", "anomaly_score")) self._parms["stopping_metric"] = stopping_metric
def download_h2o_logs(self, destination, container="ZIP"): assert_is_type(container, Enum("ZIP", "LOG")) return self._jhc.h2oContext().downloadH2OLogs(destination, container)