Optimizing LightGBM with Optuna
We’ll walk through applying Optuna using a classification example. The problem we’ll be modeling is to predict customer churn (Yes/No) for a telecommunications provider. The dataset is available from https://github.com/IBM/telco-customer-churn-on-icp4d/tree/master/data. The data describes each customer using data available to the provider – for example, gender, whether the customer is paying for internet service, has paperless billing, pays for tech support, and their monthly charges. The data consists of both numeric and categorical features. The data has already been cleaned and is balanced, allowing us to focus on the parameter optimization study.
We start by defining the objective of our parameter study. The objective
function is called once for each trial. In this case, we want to train a LightGBM model on the data and calculate the F1 score. Optuna passes a trial
object to the objective
function, which we can use...