calfcv
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.sparsematrices 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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95db8d953174f0e29f5399f429db7a919460b8e82372ff76a3dac08b38866c12
|
|
| MD5 |
f1bba6f03250a3100feb714cac343500
|
|
| BLAKE2b-256 |
7e1fa88eb3156ff29d95333cd99a0bd696ef9a1b326f7e9e8e0ff64fe3109ca1
|
Provenance
The following attestation bundles were made for calfcv-0.4.0.tar.gz:
Publisher:
release-pypi.yml on carlson-research/calfcv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
calfcv-0.4.0.tar.gz -
Subject digest:
95db8d953174f0e29f5399f429db7a919460b8e82372ff76a3dac08b38866c12 - Sigstore transparency entry: 2832314410
- Sigstore integration time:
-
Permalink:
carlson-research/calfcv@4d19bbc74ac306dafa2319ffb7c62ffea1913d32 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/carlson-research
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@4d19bbc74ac306dafa2319ffb7c62ffea1913d32 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4eadccf71b32ebd66debd222a66a59b566cf819909c2762d97569f275dd32a15
|
|
| MD5 |
e590b7b6d6101a5228635c4172667510
|
|
| BLAKE2b-256 |
c57e4bbd23431e8bdb72c1e9395676e698306b886aff104b05216518a899b292
|
Provenance
The following attestation bundles were made for calfcv-0.4.0-py3-none-any.whl:
Publisher:
release-pypi.yml on carlson-research/calfcv
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
calfcv-0.4.0-py3-none-any.whl -
Subject digest:
4eadccf71b32ebd66debd222a66a59b566cf819909c2762d97569f275dd32a15 - Sigstore transparency entry: 2832314489
- Sigstore integration time:
-
Permalink:
carlson-research/calfcv@4d19bbc74ac306dafa2319ffb7c62ffea1913d32 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/carlson-research
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-pypi.yml@4d19bbc74ac306dafa2319ffb7c62ffea1913d32 -
Trigger Event:
push
-
Statement type: