Skip to content

Latest commit

 

History

History
19 lines (10 loc) · 1.27 KB

File metadata and controls

19 lines (10 loc) · 1.27 KB

Multi class LightGBM with focal loss

Confusion matrix on the test set using the standard LightGBM classifier

Confusion matrix on the test set using the LGBMClassifier

Confusion matrix on the test set using LightGBM and the customized multi-class Focal Loss class (OneVsRestLightGBMWithCustomizedLoss)

Confusion matrix on the test set using the OneVsRestLightGBMWithCustomizedLoss

Introduction

This repository contains the source code of the medium post Multi-Class classification using Focal Loss and LightGBM

The post details how focal loss can be used for a multi class classification LightGBM model.

By using Focal Loss, sample weight balancing, or artificial addition of new samples to reduce the imbalance is not required. On an artificially generated multi-class imbalanced dataset, the use of Focal loss increased the recall value and eliminated some false positives and negatives in the minority classes.