lucacarniato / multi-class-lightgbm-with-focal-loss

Multiclass LigthGBM classifier with costumized focal loss

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

About

Multiclass LigthGBM classifier with costumized focal loss

License:MIT License


Languages

Language:Jupyter Notebook 92.4%Language:Python 7.6%