Metadata-Version: 2.1
Name: sppam
Version: 0.1.7
Summary: A classifier that endeavors to solve the saddle point problem for AUC maximization.
Home-page: https://github.com/hrolfrc/sppam
Download-URL: https://github.com/hrolfrc/sppam
Maintainer: Carlson Research, LLC
Maintainer-email: hrolfrc@gmail.com
License: new BSD
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved
Classifier: Topic :: Scientific/Engineering
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Provides-Extra: tests
Provides-Extra: docs
License-File: LICENSE

.. -*- mode: rst -*-

|Codecov|_ |CircleCI|_ |ReadTheDocs|_

.. |Codecov| image:: https://codecov.io/gh/hrolfrc/sppam/branch/master/graph/badge.svg
.. _Codecov: https://codecov.io/gh/hrolfrc/sppam

.. |CircleCI| image:: https://circleci.com/gh/hrolfrc/sppam.svg?style=shield
.. _CircleCI: https://circleci.com/gh/hrolfrc/sppam

.. |ReadTheDocs| image:: https://readthedocs.org/projects/sppam/badge/?version=latest
.. _ReadTheDocs: https://sppam.readthedocs.io/en/latest/?badge=latest

SPPAM
#####################################

An AUC optimizing binomial classifier.

Contact
------------------

Rolf Carlson hrolfrc@gmail.com

Install
------------------
Use pip to install sppam.

``pip install sppam``

Introduction
------------------
This is a python implementation of a classifier that approximates the solution to the `saddle point problem for AUC maximization`_. [1]

SPPAM provides classification and prediction for two classes, the binomial case.  Small to medium problems are supported.  This is research code and a work in progress.

SPPAM is designed for use with scikit-learn_ pipelines and composite estimators.

.. _scikit-learn: https://scikit-learn.org

.. _`saddle point problem for AUC maximization`: https://www.frontiersin.org/articles/10.3389/fams.2019.00030/full

Example
===========

.. code:: ipython2

    from sppam import SPPAM
    from sklearn.datasets import make_classification
    from sklearn.model_selection import train_test_split

Make a classification problem
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: ipython2

    seed = 42
    X, y = make_classification(
        n_samples=30,
        n_features=5,
        n_informative=2,
        n_redundant=2,
        n_classes=2,
        random_state=seed
    )
    X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=seed)

Train the classifier
^^^^^^^^^^^^^^^^^^^^

.. code:: ipython2

    cls = SPPAM().fit(X_train, y_train)

Get the score on unseen data
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code:: ipython2

    cls.score(X_test, y_test)




.. parsed-literal::

    1.0


References
------------------
[1] Natole Jr, Michael & Ying, Yiming & Lyu, Siwei. (2019).
Stochastic AUC Optimization Algorithms With Linear Convergence.
Frontiers in Applied Mathematics and Statistics. 5. 10.3389/fams.2019.00030.
