Skip to main content

LAMPS

Model-Agnostic Feature Selection via LOCO-Guided Adaptive Minipatch Sampling.

LAMPS selects feature indices using adaptive minipatch sampling. It supports custom prediction functions and grid-search hyperparameter tuning.

Installation

python -m pip install lamps-fs

The distribution is named lamps-fs; import it as lamps. Requires Python >=3.10 and NumPy >=1.25. NumPy is the only runtime dependency.

Quick start

import numpy as np
from lamps import lamps_select

rng = np.random.default_rng(100)
X = rng.normal(size=(80, 20))
y = 4 * X[:, 0] - 3 * X[:, 1] + rng.normal(size=80)

# Uses the defaults: K is chosen automatically, with up to 5 epochs.
selected = lamps_select(X, y, show_progress=True)
print(selected)  # Zero-based column indices into X.

X should be a numeric array of shape (n_samples, n_features) and y a one-dimensional numeric response of length n_samples. The default model is NumPy least-squares linear regression without an intercept. Center the data or supply a custom model if you need an intercept.

Tuning and detailed results

Pass a list for n_ratio, m_ratio, fit_func, or delta to search their Cartesian product. LAMPS chooses the run with the lowest final-epoch leave-one-out error and prints its hyperparameters.

selected, results = lamps_select(
    X, y,
    n_ratio=[0.3, 0.4],
    return_complete_info=True,
    show_progress=True,
)

The default return value is an array of selected feature indices. return_complete_info=True returns (selected, results), where results contains iteration-indexed diagnostics. seed controls the sampling randomness; custom models must manage any randomness of their own.

For a custom model, pass a callable fit_func(X_train, y_train, X_predict) that returns one prediction per row of X_predict. Install that model's dependencies separately. A list of callables enables model tuning.

Paper reproduction and license

The GitHub repository contains separate paper experiment scripts and environment instructions. Those scripts, datasets, and vendored comparison methods are not shipped in this package.

LAMPS is distributed under the MIT license, copyright 2026 LAMPS authors.

Release files for lamps-fs 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lamps-fs 0.1.2
File Size Uploaded
lamps_fs-0.1.2.tar.gz 13.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for lamps-fs 0.1.2
File Interpreter ABI Platform
lamps_fs-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 23.2 kB

Release files / lamps_fs-0.1.2.tar.gz

Download URL lamps_fs-0.1.2.tar.gz
Size 13.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5cf3b86eb71d5e36e2b60de51cacc14a3c965c51a1df9976c9da195ebb17b156
BLAKE2b-256 checksum
How to use checksums
c6b5b5a584271b05d4c9e2cda11e235d69887b10a8fdd9816fbbf860b1cbd232
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / lamps_fs-0.1.2-py3-none-any.whl

Download URL lamps_fs-0.1.2-py3-none-any.whl
Size 9.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1703bb470254fe882c893b6f97632d914af122fa8a28d6cb866038609e0d810c
BLAKE2b-256 checksum
How to use checksums
fdbfb1643115265ffedb073afb434fa63ccc8aa16fd30bbd177d9a0b3403a265
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

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