Observed since 20 Oct, 19:00 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Adaptive Lasso implementation following scikit-learn API
A scikit-learn compatible implementation of the Adaptive Lasso algorithm for feature selection and regression.
Adaptive Lasso is an extension of the standard Lasso method that provides improved feature selection properties through weighted L1 penalties. It assigns different weights to different coefficients in the L1 penalty, usually based on preliminary estimates of the coefficients.
This implementation follows the scikit-learn API design and can be used as a drop-in replacement for other scikit-learn linear models.
pip install adalasso
from adalasso import AdaptiveLasso
from sklearn.datasets import make_regression
from sklearn.model_selection import train_test_split
# Generate sample data
X, y = make_regression(n_samples=100, n_features=20, n_informative=5, random_state=42)
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
# Initialize and fit the model
model = AdaptiveLasso(alpha=0.1, gamma=1.0)
model.fit(X_train, y_train)
# Make predictions
y_pred = model.predict(X_test)
# Access model coefficients
print("Coefficients:", model.coef_)
print("Intercept:", model.intercept_)
alpha: Regularization strengthgamma: Power parameter for the adaptive weightsfit_intercept: Whether to calculate the interceptmax_iter: Maximum number of iterationstol: Tolerance for optimizationSee the class documentation for a full list of parameters.
To run the tests, you'll need to install the development dependencies:
pip install pytest pytest-cov
Then run the tests with:
pytest --cov=adalasso adalasso/tests/
The following figure shows how coefficients evolve with different regularization strengths for standard Lasso versus Adaptive Lasso:

This figure demonstrates how Adaptive Lasso performs better at selecting the correct number of non-zero features across different regularization strengths:

MIT License
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.1.1 | 28 Mar 2025 | 3 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 19:00 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:e057aebd6048422cbae7a9dbe4940a992800f0ca9474b2bc66aa389b172a14a9