Skip to contents

Setup hyperparameters for LightGBM training.

Usage

setup_LightGBM(
  max_nrounds = 500L,
  force_nrounds = NULL,
  early_stopping_rounds = 10L,
  num_leaves = 8L,
  max_depth = -1L,
  learning_rate = 0.01,
  feature_fraction = 1,
  subsample = 1,
  subsample_freq = 1L,
  lambda_l1 = 0,
  lambda_l2 = 0,
  max_cat_threshold = 32L,
  min_data_per_group = 32L,
  linear_tree = FALSE,
  ifw = FALSE,
  objective = NULL,
  device_type = "cpu",
  tree_learner = "serial",
  force_col_wise = TRUE,
  num_threads = 0L
)

Arguments

max_nrounds

Positive integer: Maximum number of boosting rounds.

force_nrounds

Positive integer: Use this many boosting rounds. Disable search for nrounds.

early_stopping_rounds

Positive integer: Number of rounds without improvement to stop training.

num_leaves

(Tunable) Positive integer: Maximum number of leaves in one tree.

max_depth

(Tunable) Integer: Maximum depth of trees.

learning_rate

(Tunable) Numeric: Learning rate.

feature_fraction

(Tunable) Numeric: Fraction of features to use.

subsample

(Tunable) Numeric: Fraction of data to use.

subsample_freq

(Tunable) Positive integer: Frequency of subsample.

lambda_l1

(Tunable) Numeric: L1 regularization.

lambda_l2

(Tunable) Numeric: L2 regularization.

max_cat_threshold

(Tunable) Positive integer: Maximum number of categories for categorical features.

min_data_per_group

(Tunable) Positive integer: Minimum number of data per categorical group.

linear_tree

Logical: If TRUE, use linear trees.

ifw

Logical: If TRUE, use Inverse Frequency Weighting in classification.

objective

Character: Objective function.

device_type

Character: "cpu" or "gpu".

tree_learner

Character: "serial", "feature", "data", or "voting".

force_col_wise

Logical: Use only with CPU - If TRUE, force col-wise histogram building

num_threads

Integer: Number of threads to use. 0 means default number of threads in OpenMP.

Details

Get more information from lightgbm::lgb.train.

Author

EDG