Skip to main content

My wonderful Lasso Regression Python package

Project description

Lasso Regression Package

License

Overview

This Python package provides a simple implementation of Lasso Regression (L1 regularization) using the Python Standard Library and NumPy. Lasso Regression is a linear regression technique that adds a penalty term proportional to the absolute values of the regression coefficients, promoting sparsity in the model.

Installation

pip install lassoreg

Usage

from lassoreg.regression import LassoRegression

# Create an instance of Lasso Regression
lasso_model = LassoRegression(alpha=0.01, max_iter=1000, tol=1e-4)

# Fit the model to training data
lasso_model.fit(X_train, y_train)

# Make predictions on new data
predictions = lasso_model.predict(X_test)

Documentation

For detailed information on the parameters and methods, please refer to the docstring in the source code.

Example

An example of generating synthetic data and fitting the Lasso Regression model is provided in the example directory.

cd example
python example.py

Testing

To run the unit tests, use the following command:

pytest tests

License

This package is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lassoreg-0.1.1.tar.gz (4.8 kB view hashes)

Uploaded Source

Built Distribution

lassoreg-0.1.1-py3-none-any.whl (4.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page