Skip to main content

A classifier that endeavors to solve the saddle point problem for AUC maximization.

Project description

CircleCI ReadTheDocs

CalfMilp

CalfMilp is a binomial classifier that implements a course approximation linear function by mixed integer linear programming.

Contact

Rolf Carlson hrolfrc@gmail.com

Install

Use pip to install calf-milp.

pip install calf-milp

Introduction

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

CalfMilp is designed for use with scikit-learn pipelines and composite estimators.

Example

from calf_milp import CalfMilp
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
Make a classification problem
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
cls = CalfMilp().fit(X_train, y_train)
Get the score on unseen data
cls.score(X_test, y_test)
0.875

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

calf_milp-0.1.8.tar.gz (9.2 kB view details)

Uploaded Source

Built Distribution

calf_milp-0.1.8-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file calf_milp-0.1.8.tar.gz.

File metadata

  • Download URL: calf_milp-0.1.8.tar.gz
  • Upload date:
  • Size: 9.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for calf_milp-0.1.8.tar.gz
Algorithm Hash digest
SHA256 f953c9bd8151428586a8b083b4a500957420342feb4eee97a7f04497a349b609
MD5 74535c4df8f97cdc24841048783f6f8d
BLAKE2b-256 7fa3ff55406b06a6d71fa6c19999318ee9fc77d6d14e2b10c1a8652dd5e015e0

See more details on using hashes here.

File details

Details for the file calf_milp-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: calf_milp-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 8.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for calf_milp-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 326ecb314b80b4d7a25de23d01ce67a0ae324e5f9dec8d5bb0528d05c78efdf4
MD5 d5ca79169c1e752d8c833f9cd0312898
BLAKE2b-256 46d8dfcac28f18819bfe5c992bbad9168bdbbd388b1c01ac961bf0ec4966633e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page