Calls lightgbm::lgb.train from package lightgbm.

Details

For categorical features either first transform factor colums with mlr3pipelines::PipeOpEncode or convert the columns with as.integer and specify the categorical columns with the categorical_feature parameter.

Dictionary

This Learner can be instantiated via the dictionary mlr_learners or with the associated sugar function lrn():

mlr_learners$get("classif.lightgbm")
lrn("classif.lightgbm")

Traits

  • Packages: lightgbm

  • Predict Types: prob, response

  • Feature Types: numeric, integer

  • Properties: importance, missings, multiclass, twoclass, weights

Custom mlr3 defaults

  • num_threads:

    • Actual default: 0L

    • Adjusted default: 1L

    • Reason for change: Prevents accidental conflicts with future.

  • verbose:

    • Actual default: 1L

    • Adjusted default: -1L

    • Reason for change: Prevents accidental conflicts with mlr messaging system.

See also

Author

kapsner

Super classes

mlr3::Learner -> mlr3::LearnerClassif -> LearnerClassifLightGBM

Methods

Public methods

Inherited methods

Method new()

Creates a new instance of this R6 class.

Usage

LearnerClassifLightGBM$new()


Method importance()

The importance scores are extracted from lbg.importance.

Usage

LearnerClassifLightGBM$importance()

Returns

Named numeric().


Method clone()

The objects of this class are cloneable with this method.

Usage

LearnerClassifLightGBM$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

# stop example failing with warning if package not installed learner = suppressWarnings(mlr3::lrn("classif.lightgbm")) print(learner)
#> <LearnerClassifLightGBM:classif.lightgbm> #> * Model: - #> * Parameters: num_threads=1, verbose=-1 #> * Packages: lightgbm #> * Predict Type: prob #> * Feature types: numeric, integer #> * Properties: importance, missings, multiclass, twoclass, weights
# available parameters: learner$param_set$ids()
#> [1] "nrounds" "objective" #> [3] "metric" "custom_eval" #> [5] "verbose" "record" #> [7] "eval_freq" "init_model" #> [9] "early_stopping_rounds" "callbacks" #> [11] "reset_data" "categorical_feature" #> [13] "boosting" "linear_tree" #> [15] "num_iterations" "learning_rate" #> [17] "num_leaves" "tree_learner" #> [19] "num_threads" "device_type" #> [21] "seed" "deterministic" #> [23] "force_col_wise" "force_row_wise" #> [25] "histogram_pool_size" "max_depth" #> [27] "min_data_in_leaf" "min_sum_hessian_in_leaf" #> [29] "bagging_fraction" "pos_bagging_fraction" #> [31] "neg_bagging_fraction" "bagging_freq" #> [33] "bagging_seed" "feature_fraction" #> [35] "feature_fraction_bynode" "feature_fraction_seed" #> [37] "extra_trees" "extra_seed" #> [39] "first_metric_only" "max_delta_step" #> [41] "lambda_l1" "lambda_l2" #> [43] "linear_lambda" "min_gain_to_split" #> [45] "drop_rate" "max_drop" #> [47] "skip_drop" "xgboost_dart_mode" #> [49] "uniform_drop" "drop_seed" #> [51] "top_rate" "other_rate" #> [53] "min_data_per_group" "max_cat_threshold" #> [55] "cat_l2" "cat_smooth" #> [57] "max_cat_to_onehot" "top_k" #> [59] "monotone_constraints" "monotone_constraints_method" #> [61] "monotone_penalty" "feature_contri" #> [63] "forcedsplits_filename" "refit_decay_rate" #> [65] "cegb_tradeoff" "cegb_penalty_split" #> [67] "cegb_penalty_feature_lazy" "cegb_penalty_feature_coupled" #> [69] "path_smooth" "interaction_constraints" #> [71] "input_model" "output_model" #> [73] "saved_feature_importance_type" "snapshot_freq" #> [75] "max_bin" "max_bin_by_feature" #> [77] "min_data_in_bin" "bin_construct_sample_cnt" #> [79] "data_random_seed" "is_enable_sparse" #> [81] "enable_bundle" "use_missing" #> [83] "zero_as_missing" "feature_pre_filter" #> [85] "pre_partition" "two_round" #> [87] "header" "group_column" #> [89] "forcedbins_filename" "save_binary" #> [91] "objective_seed" "is_unbalance" #> [93] "scale_pos_weight" "sigmoid" #> [95] "boost_from_average" "lambdarank_truncation_level" #> [97] "lambdarank_norm" "label_gain" #> [99] "metric_freq" "is_provide_training_metric" #> [101] "eval_at" "multi_error_top_k" #> [103] "auc_mu_weights" "num_machines" #> [105] "local_listen_port" "time_out" #> [107] "machine_list_filename" "machines" #> [109] "gpu_platform_id" "gpu_device_id" #> [111] "gpu_use_dp" "num_gpu" #> [113] "start_iteration" "num_iteration" #> [115] "pred_early_stop" "pred_early_stop_freq" #> [117] "pred_early_stop_margin" "output_result"