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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file lassoreg-0.1.1.tar.gz.

File metadata

  • Download URL: lassoreg-0.1.1.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for lassoreg-0.1.1.tar.gz
Algorithm Hash digest
SHA256 069cc67a597560c16d40947456cb57c41f4c3661bfc4cafb037f9b081b98f49c
MD5 7fadbc167432f07d4bdee142f25a3012
BLAKE2b-256 a13f0e79906d1921f351ad1139139baba34913e29b2c420cef47d6c54fa5351f

See more details on using hashes here.

File details

Details for the file lassoreg-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: lassoreg-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 4.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for lassoreg-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ca8567353116c2e12799dbc890c3f892fbac2d5b07a5857d88de6d9afd5c3b6f
MD5 a6ddbf9a9c1dc8ecd4ebf30ee691dafd
BLAKE2b-256 c66dffe9f92f7335eec0c0898243da713102a9ce82deeb21a6e6f38f142b2747

See more details on using hashes here.

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