Skip to main content

Python 3 Implementation of ICP and ICPRE

Project description

ICPOptimize

The Iterative Constrained Pathways Optimizer

ICP is a constrained linear model optimizer built with a focus on memory efficiency, flexibility, and solution interpretability.

Description

This repository contains implementations of the Iterative Constrained Pathways (ICP) optimization method, the ICP Rule Ensemble (ICPRE), linear classifier, regressor, and other methods. Currently, hinge, least-squares, and absolute-value loss modes are supported, with support for other loss functions planned. Coefficients can be constrained by sign or by arbitrary intervals. L1 & L2 norm constraints are also supported.

Further discussion about and motivation for the methods can be found on my blog:

nicholastsmith.wordpress.com/2021/05/18/the-iterative-constrained-pathways-optimizer/

Features

  • Linear Classification using Hinge Loss
  • Regression Support using L1 and L2 Penalties
  • Arbitrary Interval Constraints
  • L1 and L2 Coefficient Norm Constraints
  • Useful Default Settings
  • Support for DataFrames and Sparse Matrices

Installation

Install via PyPi:

pip install ICPOptimize

PyPi Project:

https://pypi.org/project/ICPOptimize/

Examples

Rule Ensemble Classifier

from ICP.Models import ICPRuleEnsemble

...

IRE = ICPRuleEnsemble().fit(A[trn], Y[trn])
YP  = IRE.predict_proba(A)

Linear Model

from ICP.Models import ICPLinearRegressor

...
# Fit linear regressor with absolute loss and L_1 norm <= 10
ILR = ICPLinearRegressor(p='l1', L1=10.0).fit(A[trn], Y[trn])
YP  = ILR.predict(A)

Further examples are available on the ICPExamples GitHub page:

https://github.com/nicholastoddsmith/ICPExamples

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

ICPOptimize-2.4.tar.gz (241.2 kB view details)

Uploaded Source

File details

Details for the file ICPOptimize-2.4.tar.gz.

File metadata

  • Download URL: ICPOptimize-2.4.tar.gz
  • Upload date:
  • Size: 241.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.11.3 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.64.0 CPython/3.9.12

File hashes

Hashes for ICPOptimize-2.4.tar.gz
Algorithm Hash digest
SHA256 464d1fdb8094a45ea27b0c2882617991a7f8806af62a4a046daa61682d505636
MD5 1530c1ea6fc63d30077cd48fa492d0f8
BLAKE2b-256 b2cf8a798b4697ce12f5f8d61772c5000119edd9c2f4f00034a03e9d3b98a45a

See more details on using hashes here.

Supported by

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