Spark ML -- Gradient Boosted Trees
Perform classification and regression using gradient boosted trees.
ml_gbt_classifier(x, formula = NULL, max_iter = 20L, max_depth = 5L, step_size = 0.1, subsampling_rate = 1, min_instances_per_node = 1L, max_bins = 32L, min_info_gain = 0, loss_type = "logistic", seed = NULL, thresholds = NULL, checkpoint_interval = 10L, cache_node_ids = FALSE, max_memory_in_mb = 256L, features_col = "features", label_col = "label", prediction_col = "prediction", probability_col = "probability", raw_prediction_col = "rawPrediction", uid = random_string("gbt_classifier_"), ...) ml_gradient_boosted_trees(x, formula = NULL, type = c("auto", "regression", "classification"), features_col = "features", label_col = "label", prediction_col = "prediction", probability_col = "probability", raw_prediction_col = "rawPrediction", checkpoint_interval = 10L, loss_type = c("auto", "logistic", "squared", "absolute"), max_bins = 32L, max_depth = 5L, max_iter = 20L, min_info_gain = 0, min_instances_per_node = 1L, step_size = 0.1, subsampling_rate = 1, seed = NULL, thresholds = NULL, cache_node_ids = FALSE, max_memory_in_mb = 256L, uid = random_string("gradient_boosted_trees_"), response = NULL, features = NULL, ...) ml_gbt_regressor(x, formula = NULL, max_iter = 20L, max_depth = 5L, step_size = 0.1, subsampling_rate = 1, min_instances_per_node = 1L, max_bins = 32L, min_info_gain = 0, loss_type = "squared", seed = NULL, checkpoint_interval = 10L, cache_node_ids = FALSE, max_memory_in_mb = 256L, features_col = "features", label_col = "label", prediction_col = "prediction", uid = random_string("gbt_regressor_"), ...)
Maxmimum number of iterations.
Maximum depth of the tree (>= 0); that is, the maximum number of nodes separating any leaves from the root of the tree.
Step size (a.k.a. learning rate) in interval (0, 1] for shrinking the contribution of each estimator. (default = 0.1)
Fraction of the training data used for learning each decision tree, in range (0, 1]. (default = 1.0)
Minimum number of instances each child must have after split.
The maximum number of bins used for discretizing continuous features and for choosing how to split on features at each node. More bins give higher granularity.
Minimum information gain for a split to be considered at a tree node. Should be >= 0, defaults to 0.
Loss function which GBT tries to minimize. Supported:
Seed for random numbers.
Thresholds in multi-class classification to adjust the probability of predicting each class. Array must have length equal to the number of classes, with values > 0 excepting that at most one value may be 0. The class with largest value
Set checkpoint interval (>= 1) or disable checkpoint (-1). E.g. 10 means that the cache will get checkpointed every 10 iterations, defaults to 10.
Maximum memory in MB allocated to histogram aggregation. If too small, then 1 node will be split per iteration, and its aggregates may exceed this size. Defaults to 256.
Features column name, as a length-one character vector. The column should be single vector column of numeric values. Usually this column is output by
Label column name. The column should be a numeric column. Usually this column is output by
Prediction column name.
Column name for predicted class conditional probabilities.
Raw prediction (a.k.a. confidence) column name.
A character string used to uniquely identify the ML estimator.
Optional arguments; currently unused.
The type of model to fit.
(Deprecated) The name of the response column (as a length-one character vector.)
(Deprecated) The name of features (terms) to use for the model fit.
The object returned depends on the class of
spark_connection, the function returns an instance of a
ml_predictorobject. The object contains a pointer to a Spark
Predictorobject and can be used to compose
ml_pipeline, the function returns a
ml_pipelinewith the predictor appended to the pipeline.
tbl_spark, a predictor is constructed then immediately fit with the input
tbl_spark, returning a prediction model.
formula: specified When
formulais specified, the input
tbl_sparkis first transformed using a
RFormulatransformer before being fit by the predictor. The object returned in this case is a
ml_modelwhich is a wrapper of a
ml_gradient_boosted_trees is a wrapper around
ml_gbt_classifier.tbl_spark and calls the appropriate method based on model type.
See http://spark.apache.org/docs/latest/ml-classification-regression.html for more information on the set of supervised learning algorithms.
Other ml algorithms: