Task-aware subspace selection with exact diagnostics. Built on nomogeo.
Project description
nomoselect
Task-aware dimensionality reduction with exact diagnostics.
PCA keeps what is biggest. nomoselect keeps what matters.
Documentation: docs.nomogenetics.com/nomoselect
What it does
nomoselect finds the lowest-dimensional view of your data that preserves the structure you actually care about. It tells you exactly what was kept and what was lost — not as a heuristic, but as an exact certificate.
Install
pip install nomoselect
Requires Python >= 3.10, numpy, scikit-learn, and nomogeo >= 0.4.0.
Quickstart
from sklearn.datasets import load_iris
from nomoselect import GeometricSubspaceSelector, ObserverReport
X, y = load_iris(return_X_y=True)
# Fit: 2 dimensions, preserving class separation
sel = GeometricSubspaceSelector(n_components=2, task="fisher")
X_proj = sel.fit_transform(X, y)
# Diagnostics: what was kept?
report = ObserverReport.from_selector(sel)
print(report.summary())
Output:
nomoselect report (2 dimensions kept)
Target structure retained : 100.0%
Target structure lost : 0.0%
Per-class retention:
0 retained 100.0% (weight=0.333)
1 retained 100.0% (weight=0.333)
2 retained 100.0% (weight=0.333)
Note: these diagnostics are exact for the task you
declared. They do not prove the task itself is valid.
Cross-validation or permutation tests are still needed
to confirm that the structure is real.
Task families
nomoselect supports multiple ways to declare what structure matters:
| Task | What it preserves | When to use |
|---|---|---|
"fisher" |
Sample-weighted class separation | Default; equivalent to Fisher/LDA |
"equal_weight" |
Equal importance per class | Unbalanced class sizes |
"minority" |
Inverse-frequency weighting | Rare-class detection |
"pairwise" |
Every class pair equally | Fine-grained separation |
Results
Task-aware observer beats PCA consistently:
| Dataset | Advantage over PCA |
|---|---|
| Iris | +0.32 |
| Wine | +1.00 (maximum possible) |
| Breast Cancer | +0.15 |
| Digits | +0.09 |
The biggest gains appear when variance and task structure point in different directions. On well-separated data where PCA already aligns with the class boundary, both methods agree.
Beyond selection: diagnostics
from nomoselect import RegularisationAudit, DimensionCostLadder
# Is my result stable across regularisation choices?
audit = RegularisationAudit.run(X, y, n_components=2)
print(audit.summary())
# How many dimensions do I actually need?
ladder = DimensionCostLadder.build(X, y)
print(ladder.summary())
How it relates to PCA and LDA
nomoselect includes Fisher/LDA as a special case. When task="fisher" and regularisation is matched, it recovers the same subspace as sklearn's LinearDiscriminantAnalysis. The difference is that nomoselect:
- tells you exactly how much target structure each dimension captures
- lets you declare alternative tasks (equal-weight, minority, pairwise)
- provides exact certificates for what was kept and what leaked
- gives you a task-aware rank selection diagram instead of a scree plot
For high-dimensional data (features >> samples), apply PCA pre-reduction first, then nomoselect.
License
BSD-3-Clause. See LICENSE.
Project details
Release history Release notifications | RSS feed
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 nomoselect-0.2.0.tar.gz.
File metadata
- Download URL: nomoselect-0.2.0.tar.gz
- Upload date:
- Size: 26.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d46003deafc9962ae4572240a0c6dc877bb6916980d35f90626183d10093cdb
|
|
| MD5 |
ab0652d0c23c16a19488af6671ade62a
|
|
| BLAKE2b-256 |
f60aafeb3e2c15b89385700e1de481ea448d79722f0f560649b0036b6858c2a0
|
File details
Details for the file nomoselect-0.2.0-py3-none-any.whl.
File metadata
- Download URL: nomoselect-0.2.0-py3-none-any.whl
- Upload date:
- Size: 21.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c00ea6b9cb3c62e90cab75d024ef06917300066e145739b16805bdd5cb7211a
|
|
| MD5 |
786f9675e10bcd62507c26628aed61d5
|
|
| BLAKE2b-256 |
008dda58c4315502729026c09e2351ae2918222d402c850b723b299350c28360
|