Skip to main content

Sorted L-One Penalized Estimation

Project description

sortedl1

CI PyPI version codecov

sortedl1 is a python package for Sorted L-One Penalized Estimation (SLOPE).

Installing

The current release can be installed from PyPI by running

pip install sortedl1

You can also install the latest development version via pip by calling

pip install git+https://github.com/jolars/sortedl1

Alternatively, you can clone the repository and install the package locally by running

pip install .

Installing from source requires a C++17 compatible compiler.

Usage

Estimators in sortedl1 are compatible with the scikit-learn interface.

import numpy as np
from numpy.random import default_rng

from sortedl1 import Slope

# Generate some random data
n = 100
p = 3

seed = 31
rng = default_rng(seed)

x = rng.standard_normal((n, p))
beta = rng.standard_normal(p)
y = x @ beta + rng.standard_normal(n)

# Fit the model
model = Slope(alpha=0.1)
model.fit(x, y)

# Print the coefficients
print(model.coef_)

Contributing

The backbone of the package is written in C++ and developed in a separate repository at https://github.com/jolars/libslope. So if you have any issues with the package other than such that are specific to the python interface, please report them there. But feel free to request features here.

When writing commit messages, please use the conventional commits format.

Versioning

sortedl1 uses semantic versioning.

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

sortedl1-0.2.3.tar.gz (843.3 kB view details)

Uploaded Source

File details

Details for the file sortedl1-0.2.3.tar.gz.

File metadata

  • Download URL: sortedl1-0.2.3.tar.gz
  • Upload date:
  • Size: 843.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for sortedl1-0.2.3.tar.gz
Algorithm Hash digest
SHA256 65a033dc23fdd5d3ce14dce8cf541df95f046ef5c5df06b1bd80f1fdc0c8fbb4
MD5 7c041e5cb317e287342e78e5bfb67a0d
BLAKE2b-256 0939f54a5b01f74ecbc6afeba43cefa11346555723e74303b15b3831c3ec7e61

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