Skip to main content

calfcv

CI PyPI Version Python Version Documentation License

A Python implementation of the Coarse Approximation Linear Function (CALF) algorithm for binomial classification and feature selection. This package provides binary classification with parsimonious and interpretable feature selection.

Features

  • Integer Weighting: Assigns integer weights for interpretable linear models.
  • Cross-Validation: Built in cross validation for automated hyperparameter tuning and feature selection.
  • Sparse Data Support: Processes high-dimensional scipy.sparse matrices with stable memory usage.
  • Multiclass and Multilabel: Supports Scikit-Learn OneVsRestClassifier.
  • Scikit-Learn Compatibility: Plugs directly into Pipeline, GridSearchCV, and standard estimator workflows.

Installation

Use pip to install calfcv:

pip install calfcv

Quick Start Example

Make a classification problem and train the classifier:

from calfcv import CalfCV
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 = CalfCV().fit(X_train, y_train)

# Get the score on unseen data
print(cls.score(X_test, y_test))
# Output: 0.875

Citation

If you use this package in your research, please cite:

Jeffries, C.D., Ford, J.R., Tilson, J.L. et al. A greedy regression algorithm with coarse weights offers novel advantages. Sci Rep 12, 5440 (2022). https://doi.org/10.1038/s41598-022-09415-2

License

This project is licensed under the BSD-3-Clause License - see the LICENSE file for details.

Authors

  • CALF Algorithm: Clark D. Jeffries, John R. Ford, Jeffrey L. Tilson, Diana O. Perkins, Darius M. Bost, Dayne L. Filer, and Kirk C. Wilhelmsen
  • CalfCV Python Package (calfcv): Rolf Carlson (rolf@hrolfrc.com)

Download files

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

Source Distribution

calfcv-0.4.0.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

calfcv-0.4.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file calfcv-0.4.0.tar.gz.

File metadata

  • Download URL: calfcv-0.4.0.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for calfcv-0.4.0.tar.gz
Algorithm Hash digest
SHA256 95db8d953174f0e29f5399f429db7a919460b8e82372ff76a3dac08b38866c12
MD5 f1bba6f03250a3100feb714cac343500
BLAKE2b-256 7e1fa88eb3156ff29d95333cd99a0bd696ef9a1b326f7e9e8e0ff64fe3109ca1

See more details on using hashes here.

Provenance

The following attestation bundles were made for calfcv-0.4.0.tar.gz:

Publisher: release-pypi.yml on carlson-research/calfcv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file calfcv-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: calfcv-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 15.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for calfcv-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4eadccf71b32ebd66debd222a66a59b566cf819909c2762d97569f275dd32a15
MD5 e590b7b6d6101a5228635c4172667510
BLAKE2b-256 c57e4bbd23431e8bdb72c1e9395676e698306b886aff104b05216518a899b292

See more details on using hashes here.

Provenance

The following attestation bundles were made for calfcv-0.4.0-py3-none-any.whl:

Publisher: release-pypi.yml on carlson-research/calfcv

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

0.3.17

2 files

0.3.16

2 files

0.3.15

2 files

0.3.13

2 files

0.3.12

2 files

0.3.11

2 files

0.3.10

2 files

0.3.8

2 files

0.3.5

2 files

0.3.4

2 files

0.3.1

2 files

0.3.0

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.1.41

2 files

0.1.39

2 files

0.1.28

2 files

0.1.27

2 files

0.1.26

2 files

0.1.25

2 files

0.1.24

2 files

0.1.23

2 files

0.1.22

2 files

0.1.21

2 files

0.1.20

2 files

0.1.19

2 files

0.1.17

2 files

0.1.16

2 files

0.1.15

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.8

2 files

0.1.3

2 files

0.1.1

2 files

0.0.22

2 files

0.0.20

2 files

0.0.15

2 files

0.0.14

2 files

0.0.12

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page