Skip to contents

Wraps gbm::gbm when available, otherwise falls back to xgboost as a portable boosted-trees backend.

Usage

morie_gradient_boosting_ensemble(
  x,
  y,
  n_estimators = 100L,
  learning_rate = 0.1,
  max_depth = 3L,
  task = "auto",
  seed = 0L,
  deterministic_seed = NULL
)

Arguments

x

Numeric predictor matrix.

y

Response.

n_estimators

Number of boosting iterations.

learning_rate

Shrinkage nu.

max_depth

Depth of each tree.

task

"auto", "classification", or "regression".

seed

RNG seed.

deterministic_seed

Integer or NULL. If supplied, the RNG state is derived from the SHA-keyed morie_det_rng() so Py<->R streams agree on the canonical fixture. When NULL (default), behaviour is unchanged: seed drives set.seed() directly.

Value

Named list: estimate, train_score, feature_importances, n_estimators, learning_rate, max_depth, task, n, method.

Examples

morie_gradient_boosting_ensemble(x = rnorm(50), y = rnorm(50))
#> $estimate
#> [1] 0.4500976
#> 
#> $train_score
#> [1] 0.4500976
#> 
#> $feature_importances
#> [1] 0.153532 0.846468
#> 
#> $n_estimators
#> [1] 100
#> 
#> $learning_rate
#> [1] 0.1
#> 
#> $max_depth
#> [1] 3
#> 
#> $task
#> [1] "regression"
#> 
#> $backend
#> [1] "gbm"
#> 
#> $n
#> [1] 50
#> 
#> $method
#> [1] "Gradient Boosting (regression, gbm)"
#>