-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add some basic information on readme
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,41 @@ | ||
# sortedl1 | ||
|
||
**sortedl1** is a python package for Sorted L-One Penalized Estimation. | ||
|
||
## Installing | ||
|
||
sortedl1 is currently only available on github. To install it, run | ||
|
||
```python | ||
pip install -U git+https://github.com/jolars/sortedl1 | ||
``` | ||
|
||
# Usage | ||
|
||
Estimators in **sortedl1** are compatible with the scikit-learn interface. | ||
|
||
```python | ||
import numpy as np | ||
from numpy.random import default_rng | ||
|
||
from sortedl1 import Slope | ||
|
||
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) | ||
|
||
model = Slope() | ||
model.fit(x, y) | ||
|
||
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. |