二値分類タスクでは、クラスの不均衡性で目的関数の重みづけが重要となる場合があります。LightGBMの場合 params = { 'objective' : objective, 'metric' : metric, 'boosting_type': boosting_type, 'device': device, 'random_state':39, 'is_unbalance': True, #設定する 'verbose':-1 } # 重みを計算する関数 def calc_log_loss_weight(y_true): nc = np.bincount(y_true) w0, w1 =…