Giter Site home page Giter Site logo

dmitryasdre / rocauc_pairwise Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 0.0 1.81 MB

RocAuc Pairiwse objective for gradient boosting

License: GNU General Public License v3.0

Python 54.20% Cuda 22.94% Cython 12.44% C++ 10.42%
binary-classification cuda cuda-programming cython-wrapper gpu-accelerated-library gpu-acceleration gpu-computing gradient-boosting gradient-boosting-classifier lambdarank

rocauc_pairwise's Introduction

RocAuc Pairwise objective for gradient boosting

This is GPU implementation of rocauc pairwise objective for gradient boosting: $$L = \sum_{i, j} \left(\hat P_{ij}\log{P_{ij}} + (1 - \hat P_{ij})\log{(1 - P_{ij})}\right)\lvert \Delta_{AUC_{ij}}\vert$$ Where: $$P_{ij} = \frac{1}{1 + e^{-(x_i - x_j)}} $$ This package could be used to solve classification problems with relative small numbers of objects, where you need to improve rocauc score.
Also there is cpu multithread implementation of this objectives and losses.

Objectives that are implemented in this package

  1. Sigmoid pairwise loss. (GPU or CPU implementations) $$L = \sum_{i, j}\left(\hat P_{ij}\log{P_{ij}} + (1 - \hat P_{ij})\log{(1 - P_{ij})}\right)$$
  2. RocAuc Pairwise Loss with approximate auc computation. (GPU or CPU implementations) $$L = \sum_{i, j} \left(\hat P_{ij}\log{P_{ij}} + (1 - \hat P_{ij})\log{(1 - P_{ij})}\right)\lvert \Delta_{AUC^{approx}_{ij}}\vert$$
  3. RocAuc Pairwise Loss Exact (GPU or CPU implementations) with exact auc computation. This could be more compute intensive, but this loss might be helpfull for first boosting rounds (if you are using gradient boosting) $$L = \sum_{i, j} \left(\hat P_{ij}\log{P_{ij}} + (1 - \hat P_{ij})\log{(1 - P_{ij})}\right)\lvert \Delta_{AUC^{exact}_{ij}}\vert$$
  4. RocAuc Pairwise Loss Exact Smoothened (GPU or CPU implementations). This loss allows you to incorporate information about equal instances. Because $\Delta_{AUC_{ij}} = 0$ if $y_i = y_j$. So we just add small $\epsilon > 0$ in equation. $$L = \sum_{i, j} \left(\hat P_{ij}\log{P_{ij}} + (1 - \hat P_{ij})\log{(1 - P_{ij})}\right)(\epsilon + \lvert \Delta_{AUC^{exact}_{ij}}\vert)$$

Installation

You can use pip to install this package.

pip install roc_auc_pairwise

Project page on PyPI - roc_auc_pairwise

Basic usage examples.

  • You can see example notebook: ./examples/gradient_boosting_example.ipynb
  • Or you can try to run example notebook on Google Colab
  • Or you can try to run example notebook on Kaggle

Performance

Losses, Gradients and Hessians are require $\mathcal{O}(n^2)$ to compute. So it is very compute intensive.
Here you can see package perfomance on Intel Core i5 10600KF and Nvidia RTX 3060.
Performance plots

References

[1] Sean J. Welleck, Efficient AUC Optimization for Information Ranking Applications, IBM USA (2016)
[2] Burges, C.J.: From ranknet to lambdarank to lambdamart: An overview. Learning (2010)
[3] Calders, T., Jaroszewicz, S.: Efficient auc optimization for classification. Knowledge Discovery in Databases. (2007)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.