Skip to content

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

Repository files navigation

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published