Skip to main content

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

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

CC BY 4.0

Changelog

0.1.4

  • Added reconstruction_mse(X) method to ICALCC: computes mean squared reconstruction error in the original feature space via inverse_transform. Inherited by GPUICALCC without changes.
  • Renamed contrast 'skew' to 'cube' for clarity; 'skew' is retained as a legacy alias.

0.1.3

  • Initial public release.

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)

Source distribution for icalcc 0.1.4
File Size Uploaded
icalcc-0.1.4.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for icalcc 0.1.4
File Interpreter ABI Platform
icalcc-0.1.4-py3-none-any.whl Python 3 none any Details

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

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release 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