Skip to contents

Performs a grid search over LightGBM hyperparameters using the same rolling time windows as the imbalance tournament. Optimises PR-AUC on the pre-baked baseline data stored in MinIO. Returns the best parameters as a named list ready for use in evaluate_final_model() and train_production_model().

Usage

tune_lgbm(
  imbalance_windows,
  bucket_name = "lake",
  inputs_prefix = "baf-fraud/05_model_input",
  grid_size = 30L,
  seed = 42L
)

Arguments

imbalance_windows

A tibble with columns window_id, train_months, and test_month, as produced by the imbalance_windows target.

bucket_name

Character. MinIO bucket name. Default "lake".

inputs_prefix

Character. Prefix for the model input layer. Default "05_model_input".

grid_size

Integer. Number of space-filling candidates. Default 30.

seed

Integer. Random seed for reproducibility. Default 42.

Value

A named list with elements trees, tree_depth, learn_rate, and min_n.