Skip to contents

Train lightgbm model

Usage

lightgbm_train(data, label, params, ...)

Arguments

data

Training data.

label

Labels.

params

A list of parameters.

...

Additional parameters.

Value

A model object.

Examples

sim_data <- msaenet::msaenet.sim.binomial(
  n = 100,
  p = 10,
  rho = 0.6,
  coef = rnorm(5, mean = 0, sd = 10),
  snr = 1,
  p.train = 0.8,
  seed = 42
)

fit <- suppressWarnings(
  lightgbm_train(
    data = sim_data$x.tr,
    label = sim_data$y.tr,
    params = list(
      objective = "binary",
      learning_rate = 0.1,
      num_iterations = 100,
      max_depth = 3,
      num_leaves = 2^3 - 1,
      num_threads = 1
    ),
    verbose = -1
  )
)

fit
#> LightGBM Model (100 trees)
#> Objective: binary
#> Fitted to dataset with 10 columns