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

After the first PyPI release:

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. No R installation or experiment datasets are needed.

Before publication, developers can run python -m pip install . from the repository root.

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)

# A small demonstration budget; omit K and max_iter to use the defaults.
selected = lamps_select(X, y, K=300, max_iter=2, show_progress=False)
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],
    delta=[0.7, 0.8],
    K=300,
    max_iter=2,
    return_complete_info=True,
    show_progress=False,
)

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.1

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.1
File Size Uploaded
lamps_fs-0.1.1.tar.gz 13.8 kB Details

Built distribution (wheel)

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

Total release size: 23.5 kB

Release files / lamps_fs-0.1.1.tar.gz

Download URL lamps_fs-0.1.1.tar.gz
Size 13.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b1c3e06a5266bcae92931cb862ac4b9bd1113aa39dc4ac9fb88a6c516f6733bc
BLAKE2b-256 checksum
How to use checksums
2a6abcbc644da156ee03dfcba9e786a616cd9476e054918e36a1225ca77fb93d
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.1-py3-none-any.whl

Download URL lamps_fs-0.1.1-py3-none-any.whl
Size 9.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
71e61f5eff4ddeb679a26598e0b739f5896a28ed11819e0879030898f933acd5
BLAKE2b-256 checksum
How to use checksums
bc4ef354163e98f659bc6c1b3a75ebdc0dafd94d90f5f165559b89feec78e78c
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

0.1.2

2 release files

This release

0.1.1 This release

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