icalcc
Locally centered contrast functions for scikit-learn FastICA.
Drop-in replacement for sklearn.decomposition.FastICA with
bounded LCC-tanh and LCC-exp contrasts, plus polynomial LCC
contrasts of order 4, 6, and 8.
from icalcc import ICALCC
ica = ICALCC(n_components=4, K='ltanh', random_state=0)
S_hat = ica.fit_transform(X)
Installation
pip install icalcc
Supported K Values
| K | Description |
|---|---|
'ltanh' |
Bounded LCC-tanh (robust to heavy tails and skewness) |
'lexp' |
Bounded LCC-exp (maximizes Rényi-2 entropy) |
4 |
Polynomial LCC order 4 |
6 |
Polynomial LCC order 6, couples m₃, m₄, m₆ |
8 |
Polynomial LCC order 8, couples moments up to order 8 |
'tanh' |
Classical logcosh contrast (scikit-learn default) |
'exp' |
Classical Gaussian contrast |
'cube' |
Classical cube contrast ('skew' accepted as alias) |
Usage
from icalcc import ICALCC
# Bounded LCC-tanh (recommended for heavy-tailed or skewed sources)
ica = ICALCC(n_components=4, K='ltanh', random_state=0)
S_hat = ica.fit_transform(X)
# Bounded LCC-exp (Rényi-2 entropy interpretation)
ica = ICALCC(n_components=4, K='lexp', random_state=0)
S_hat = ica.fit_transform(X)
# Polynomial LCC order 8 (near-Gaussian sources)
ica = ICALCC(n_components=4, K=8, random_state=0)
S_hat = ica.fit_transform(X)
# Classical FastICA baseline
ica = ICALCC(n_components=4, K='tanh', random_state=0)
S_hat = ica.fit_transform(X)
Convergence tracking
ica.fit(X)
print(ica.converged_) # True if all components converged
Reconstruction MSE
ica = ICALCC(n_components=3, K='lexp', random_state=0)
ica.fit(X)
mse = ica.reconstruction_mse(X)
print(f"Reconstruction MSE: {mse:.6f}")
reconstruction_mse transforms X to sources and reconstructs via
the mixing matrix in the original feature space. Meaningful only in
the undercomplete case (n_components < n_features); returns 0.0
exactly when n_components == n_features.
Inherited automatically by
gpuicalcc.
See Also
- gpuicalcc — PyTorch GPU-accelerated extension (40–48× speedup for bounded contrasts)
- Experiment code
Requirements
- Python ≥ 3.9
- numpy ≥ 1.24
- scikit-learn ≥ 1.3
Citation
If you use this package, please cite both the software paper and the underlying LCC kernel paper:
@article{saito2026icalcc,
author = {Saito, Tetsuya},
title = {{ICALCC}: Locally Centered Contrast Functions for
{FastICA} with {GPU} Acceleration},
journal = {TechRxiv},
year = {2026},
doi = {10.36227/techrxiv.177203264.46969730}
}
@article{saito2026lcc,
author = {Saito, Tetsuya},
title = {Locally Centered Cyclic Kernels for Higher-Order
Independent Component Analysis},
journal = {TechRxiv},
year = {2026},
doi = {10.36227/techrxiv.177220376.62411390}
}
License
Changelog
0.1.4
- Added
reconstruction_mse(X)method toICALCC: computes mean squared reconstruction error in the original feature space viainverse_transform. Inherited byGPUICALCCwithout changes. - Renamed contrast
'skew'to'cube'for clarity;'skew'is retained as a legacy alias.
0.1.3
- Initial public release.
Metadata
Release files for icalcc 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| icalcc-0.1.4.tar.gz | 6.8 kB | Without provenance | Details for icalcc-0.1.4.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| icalcc-0.1.4-py3-none-any.whl | Python 3 | none | any | Details for icalcc-0.1.4-py3-none-any.whl |
Total release size: 13.9 kB
Release files / icalcc-0.1.4.tar.gz
| Download URL | icalcc-0.1.4.tar.gz |
|---|---|
| Size | 6.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
89a1699f64df6bd736eddf9c34490af9027be15e51b69a7b07455a2d914dd88b
|
|
BLAKE2b-256 checksum How to use checksums |
429ac2e7bf99c34be4277ae80fda8e940df7ec86aac81a73faa11974632d859c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Release files / icalcc-0.1.4-py3-none-any.whl
| Download URL | icalcc-0.1.4-py3-none-any.whl |
|---|---|
| Size | 7.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
df5bbcfb56ac92a3065e6ef061c308c535f8eb4ce4a03b6c34314ffa2f8d3660
|
|
BLAKE2b-256 checksum How to use checksums |
6c07fd165de68fd64718c8d08c1acaaec0cd775aed3c1828b600b056b7c8376e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.4
|
Security for icalcc 0.1.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.