ICSpyLab: Invariant Coordinate Selection
- ICSpyLab is a Python package implementing invariant coordinate selection, a dimensionality reduction method that jointly diagonalizes two scatter matrices.
- The tool provides a scikit-learn-compatible workflow with extensible abstractions for custom scatter estimation and component selection, facilitating clustering and anomaly detection.
- It supports multiple algorithms and selection criteria to balance statistical robustness and numerical performance, differentiating it from variance-based PCA.
ICSpyLab is a Python package for invariant coordinate selection (ICS), a linear dimension-reduction method based on the joint diagonalization of two scatter matrices rather than the diagonalization of a single covariance matrix. In the available arXiv literature, it is presented as the first dedicated Python implementation of ICS, designed to bring a method with established relevance for clustering, anomaly detection, and unsupervised linear feature extraction into a unified, scikit-learn-compatible workflow (Becquart, 23 Jun 2026).
1. Definition and scope
ICSpyLab implements invariant coordinate selection as a practical software system. ICS is described as a dimensionality reduction technique that seeks informative directions that are not necessarily those of largest variance. This distinguishes it from principal component analysis (PCA), which relies on variance alone. The package motivation is explicitly software-oriented: prior ICS software existed only in R and was split across several packages, which made the method less accessible to Python users and harder to integrate into modern machine-learning workflows (Becquart, 23 Jun 2026).
The package is positioned simultaneously as a practical tool and a research platform. Its implementation follows a standard estimator interface, exposes extensibility points for scatter estimation and component selection, and is intended for both practitioners and methodological work. The surrounding documentation is said to include detailed explanations and reproducible examples, including the RANDU experiment and plotting scripts (Becquart, 23 Jun 2026).
A recurrent source of confusion is the relationship between ICS and PCA. The package paper is explicit that ICS is not simply a variance-based rotation. PCA diagonalizes one scatter matrix, usually the covariance matrix, and therefore finds directions of maximal variance. ICS jointly diagonalizes two scatter matrices and orders directions by discrepancies between two notions of scatter, often interpreted through generalized kurtosis or other non-Gaussian structure. This is why ICS can reveal clustering structure, outlying subspaces, or other deviations from elliptically symmetric Gaussian-like behavior that PCA may miss (Becquart, 23 Jun 2026).
2. Mathematical basis of invariant coordinate selection
The central computational object in ICS is a pair of positive definite scatter matrices, denoted and . A scatter matrix is described as a positive definite matrix summarizing dispersion of a multivariate random vector, generalizing covariance, and satisfying affine equivariance. ICS seeks a matrix such that
where is the identity and is diagonal (Becquart, 23 Jun 2026).
Equivalently, the rows of are generalized eigenvectors solving
or, when is invertible,
The invariant coordinates are then obtained by the linear transformation
0
or, in matrix form,
1
The diagonal entries 2 of 3 are the generalized eigenvalues, and ordering them from largest to smallest or vice versa yields invariant components associated with extreme generalized kurtosis (Becquart, 23 Jun 2026).
The paper also gives an optimization view consistent with the generalized eigenproblem:
4
with subsequent directions constrained to be 5-orthogonal. In this form, ICS appears as the analogue of PCA’s variance maximization, but with one scatter normalized by another. When 6 is covariance and 7 is a fourth-moment-based scatter such as 8, the resulting eigenvalues can be interpreted as generalized kurtosis indices (Becquart, 23 Jun 2026).
The whitening formulation clarifies the geometry of the method. If 9, define
0
so that
1
Then diagonalize the whitened second scatter,
2
and obtain
3
This construction satisfies the defining joint-diagonalization identities and explains the package’s whiten algorithm (Becquart, 23 Jun 2026).
3. Package architecture and software abstractions
The core estimator is an ICS class inheriting from scikit-learn’s BaseEstimator. The interface therefore follows the usual transformer pattern:
fit(X)estimates the invariant-coordinate transformation.transform(X)applies the fitted transformation.fit_transform(X)performs both steps in one call.
Because of this design, ICSpyLab can be inserted into pipelines and used with model-selection or cross-validation tooling in the same way as other preprocessing transformers (Becquart, 23 Jun 2026).
Two abstraction layers organize extensibility. The first is Scatter, an abstraction for scatter estimators. Since ICS depends critically on the choice of two scatter matrices, this abstraction allows users to plug in custom scatter estimators in addition to those bundled with the package. The second is ComponentSelect, an abstraction for component-selection methods. Since one often wants to retain only a subset of invariant components, this layer supports both built-in criteria and custom selection rules (Becquart, 23 Jun 2026).
This architecture reflects the full ICS workflow rather than only the diagonalization step. A typical usage pattern consists of specifying the two scatters 4 and 5, choosing an algorithm for computing invariant components, and optionally applying a component-selection rule before downstream clustering or outlier scoring. The paper explicitly describes the resulting integration pattern as a preprocessing stage of the form
6
A plausible implication is that ICSpyLab is intended not merely as a numerical linear-algebra wrapper, but as a composable preprocessing primitive for modern unsupervised workflows (Becquart, 23 Jun 2026).
4. Supported scatters, algorithms, and selection criteria
The package exposes a broad collection of scatter matrices, four algorithms for invariant-component computation, and three built-in component-selection criteria. The implementation emphasis is modularity: scatter-matrix choice determines the statistical notion of structure being contrasted, algorithm choice determines how the joint diagonalization is realized numerically, and component selection determines which invariant coordinates are retained for downstream analysis (Becquart, 23 Jun 2026).
| Family | Name | Description |
|---|---|---|
| Scatter | cov |
classical covariance |
| Scatter | covW |
weighted covariance linked to Tukey-style ideas |
| Scatter | cov4 |
fourth-moment scatter |
| Scatter | covAxis |
principal-axis-type scatter |
| Scatter | mcd |
minimum covariance determinant robust scatter |
| Scatter | tcov |
pairwise scatter |
| Scatter | tcovAxis |
axis-based pairwise scatter |
| Scatter | tM |
multivariate 7-based scatter |
The supported algorithms are eigh, standard, whiten, and QR. The paper characterizes them as follows. eigh uses a standard symmetric generalized eigensolver from SciPy. standard corresponds to the classical ICS implementation approach from the R ICS package. whiten computes invariant coordinates through whitening with one scatter matrix followed by diagonalization of the other in whitened space. QR implements the numerically motivated method from Archimbaud et al. (2023), intended to improve numerical behavior in joint diagonalization (Becquart, 23 Jun 2026).
| Category | Name | Role |
|---|---|---|
| Algorithm | eigh |
generalized eigensolver from SciPy |
| Algorithm | standard |
classical ICS implementation approach |
| Algorithm | whiten |
whitening plus diagonalization |
| Algorithm | QR |
numerically motivated joint diagonalization |
| Selection | Median criterion | built-in component selection |
| Selection | Normal criterion | built-in component selection |
| Selection | Unimodality criterion | built-in component selection |
The three component-selection criteria are the Median criterion, the Normal criterion, and the Unimodality criterion. The paper attributes the median and normal criteria to Alfons et al. (2024) and the unimodality criterion to Becquart et al. (2026). Although explicit formulas are not given there, the criteria are described as identifying components deviating from Gaussianity or unimodality, which is useful when selecting invariant coordinates for clustering or outlier detection (Becquart, 23 Jun 2026).
The package discussion also makes a methodological point: scatter-matrix choice affects both robustness and computational cost. Classical covariance is simple and efficient but sensitive to contamination; robust and pairwise scatters such as mcd, tcov, or tcovAxis are described as more resilient and often better suited to clustering and anomaly tasks, though potentially more computationally demanding. This suggests that ICSpyLab is best understood as a framework for controlled trade-offs among statistical robustness, numerical behavior, and workflow integration (Becquart, 23 Jun 2026).
5. Workflow, PCA comparison, and illustrative use cases
The package paper gives a minimal example:
9
This example uses the RANDU dataset, described as a classical pathological random-number dataset in which observations lie on parallel hyperplanes. With S1="cov" and S2="tcovAxis", the paper reports that ICS reveals the hyperplane structure on the last invariant component, whereas PCA fails to reveal it in the corresponding principal components. The example is intended as a reproducible demonstration that informative structure may reside in low-variance directions and therefore be missed by variance-only methods (Becquart, 23 Jun 2026).
The intended use cases emphasized in the package are clustering, anomaly or outlier detection, and unsupervised linear feature extraction. For clustering, the paper notes that effective scatter pairs often combine a matrix capturing global structure with one capturing within-cluster or local structure. Local-shape, pairwise, and robust scatter choices such as mcd, tcov, or tcovAxis are therefore identified as especially relevant. For anomaly detection, ICS is described as advantageous when a small fraction of outliers lies in a low-dimensional subspace, because those directions can emerge in the extreme invariant components (Becquart, 23 Jun 2026).
The comparison with PCA is central to the package’s significance. PCA solves
8
and therefore orders directions by variance. Its components are only orthogonally invariant. ICS, by contrast, compares two scatter structures and is affine invariant. In practical terms, PCA can miss low-variance but highly informative directions, whereas ICS can place those directions among the first or last invariant components depending on the scatter pair. The paper explicitly states that recent work shows ICS outperforming PCA as a preprocessing step for clustering and anomaly detection. A common misconception is therefore that ICS is simply a robustified PCA; the package literature instead presents it as a distinct affine-invariant framework whose ordering criterion depends on disagreement between two scatter notions rather than on variance alone (Becquart, 23 Jun 2026).
6. Implementation, availability, and future directions
ICSpyLab is implemented on top of NumPy, SciPy, scikit-learn, Matplotlib, and Numba. Several implementation details are specified. The mcd scatter is implemented as a wrapper around scikit-learn’s MCD estimator. Pairwise scatter matrices tcov and tcovAxis are accelerated using Numba JIT compilation. The use of standard scientific Python libraries is described as supporting reliability and consistency (Becquart, 23 Jun 2026).
The package also includes utilities for experimentation and reproducibility. The paper mentions generators for multivariate exponential power distributions and mixtures of elliptical distributions, as well as visualization tools. This broadens the package from an estimator implementation into an environment for method testing and demonstration. The documentation is said to contain detailed explanations and reproducible examples, and the software is released under the MIT license at https://github.com/cbecquart/ICSpyLab (Becquart, 23 Jun 2026).
The limitations identified in the package discussion are mainly methodological rather than infrastructural. The current implementation offers a substantial but still finite set of scatters, algorithms, and selection criteria. ICS itself also requires careful choice of scatter pair and component-selection strategy. Future work identified in the paper includes support for functional data, new component-selection criteria, and methods tailored to high-dimensional settings. The package also emphasizes fostering community contributions in the Python ecosystem (Becquart, 23 Jun 2026).
Within the available arXiv record, the exact title “ICSpyLab” refers to this invariant-coordinate-selection package rather than to unrelated systems in imaging analysis, industrial reverse engineering, or industrial penetration testing, which appear under distinct names such as “The Imaging Computational Microscope” (Frady et al., 2015), “ICSREF” (Keliris et al., 2018), and “ICSSPulse” (Takaronis et al., 24 Feb 2026). In that sense, ICSpyLab occupies a specific place in the scientific Python ecosystem: it translates a generalized-eigenproblem-based, affine-invariant dimension-reduction method into a coherent software library for clustering, anomaly detection, and extensible methodological research.