Uh oh!
There was an error while loading. Please reload this page.
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #20 +/- ##
==========================================
+ Coverage 88.71% 89.00% +0.29%
==========================================
Files 21 24 +3 Lines 1506 1874 +368 ==========================================
+ Hits 1336 1668 +332 - Misses 170 206 +36 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds two new multiblock feature transformers—CIFE and AJIVE—to the kalelinear.transformer API, along with tests and documentation updates so they can be used via both kalelinear.transformer and the PyKale-style kalelinear.embed module.
Changes:
- Implement CIFE and AJIVE, plus a shared multiblock base/validation layer.
- Add unit tests and shared synthetic multiblock dataset generator for validating common/individual subspace recovery.
- Update README, tutorials, and Sphinx API docs to surface the new transformers.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| TUTORIALS.md | Adds a usage example for CIFE/AJIVE common + individual feature extraction. |
| README.md | Lists CIFE/AJIVE as supported transformers and adds citations. |
| tests/utils/test_utils.py | Adds a synthetic multiblock dataset generator for common/individual structure. |
| tests/transformer/test_cife.py | Adds test coverage for CIFE fit/transform behavior and validation. |
| tests/transformer/test_ajive.py | Adds test coverage for AJIVE fit/transform behavior and validation. |
| tests/test_public_api.py | Ensures new transformers are exposed via the public API modules. |
| kalelinear/transformer/_multiblock.py | Introduces shared multiblock input handling and a base transformer class. |
| kalelinear/transformer/_cife.py | Implements the CIFE algorithm and its COBE-based common subspace extraction. |
| kalelinear/transformer/_ajive.py | Implements the AJIVE algorithm including Wedin-bound based rank selection. |
| kalelinear/transformer/init.py | Exposes CIFE and AJIVE in the transformer package namespace. |
| kalelinear/embed.py | Exposes CIFE and AJIVE via the PyKale-style embed module. |
| docs/source/introduction.rst | Updates the “Main Features” list to include CIFE/AJIVE. |
| docs/source/api_transformers.rst | Adds API doc entries for CIFE and AJIVE. |
| docs/source/api_embed.rst | Adds API doc entries for CIFE and AJIVE under kalelinear.embed. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.
Suppressed comments (3)
Previously missed (3) — in code that hasn't changed since the last review.
kalelinear/transformer/_multiblock.py:167
transform()uses_check_multiblock_input(X)for list/tuple inputs, which enforces a minimum of two blocks. This prevents projecting a single new block at transform-time even though the common projection does not require multiple blocks (and the docstring suggests any “list of blocks” is acceptable). Consider validating list inputs here without the “>= 2 blocks” constraint, and just stack the blocks for projection.
if isinstance(X, (list, tuple)):
blocks, _ = _check_multiblock_input(X)
X_stacked = np.vstack(blocks)
kalelinear/transformer/_ajive.py:208
percentileis a configurable parameter, but the branch choosing betweenrandom_ssv_boundand the Wedin-based bound compares against a hard-coded 5th percentile (np.percentile(wedin_ssv_bounds, 5)). This makes behavior inconsistent whenpercentileis not 5 and likely ignores the user-configured setting.
wedin_ssv_bound = np.percentile(wedin_ssv_bounds, self.percentile)
random_ssvs = _random_direction_ssv(D, ranks, 100, self.random_state_)
random_ssv_bound = np.percentile(random_ssvs, 95)
if random_ssv_bound > np.percentile(wedin_ssv_bounds, 5):
joint_rank = int(np.sum(s_stacked**2 + _FERROR > random_ssv_bound))
tests/utils/test_utils.py:133
make_common_individual_datasetis parameterized byn_blocks, but it indexesindividual_ranks[k]/n_samples[k]without validating their lengths. Calling it with a differentn_blocksthan the default will raise anIndexErrorinstead of a clear error message.
for k in range(n_blocks):
individual_basis, _ = np.linalg.qr(random_state.randn(n_features, individual_ranks[k]))
individual_basis -= common_basis @ (common_basis.T @ individual_basis)
individual_basis, _ = np.linalg.qr(individual_basis)
block = random_state.randn(n_samples[k], n_common) @ common_basis.T
| .. toctree:: | ||
| :maxdepth: 2 | ||
| api_embed | ||
| api_transformers | ||
| api_predict | ||
| api_estimators | ||
| api_utilities | ||
Uh oh!
There was an error while loading. Please reload this page.
Description
Add two new algorithms, AJIVE and CIFE, under the transformer API
Status
Work in progress
Types of changes
docsupdated.