-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
92 additions
and
93 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
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
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
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,10 +1,23 @@ | ||
🌰 Example | ||
========== | ||
Example | ||
======= | ||
|
||
- SVM and FairSVM [colab: svm_] | ||
Example Gallery | ||
--------------- | ||
|
||
.. _svm: https://colab.research.google.com/drive/1f_7t1t6FNxAooQOmpyhHCOVq0IKgMxe-?usp=sharing | ||
.. nblinkgallery:: | ||
:caption: A few links | ||
:name: rst-link-gallery | ||
|
||
- Quantile Regression [colab: qt_] | ||
examples/ReHLine_QR | ||
examples/ReHLine_SVM_FairSVM | ||
|
||
List of Examples | ||
---------------- | ||
|
||
.. toctree:: | ||
:maxdepth: 0 | ||
|
||
examples/ReHLine_QR.ipynb | ||
examples/ReHLine_SVM_FairSVM.ipynb | ||
|
||
|
||
.. _qt: https://colab.research.google.com/drive/1LwatjwjnMSB97eLVyuOiUY3sl3A3Ie__?usp=sharing |
File renamed without changes.
File renamed without changes.
File renamed without changes
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
Getting started | ||
=============== | ||
|
||
This page provides a starter example to introduce users to the ``rehline`` package and showcase its primary features, facilitating exploration and familiarization. | ||
|
||
To proceed, make sure that you have already installed ``rehline``: | ||
|
||
.. code:: bash | ||
pip install rehline | ||
-------------------------------- | ||
|
||
``rehline`` is a generic solver for flexible machine learning Empirical Risk Minimization (ERM), particularly suited for formulations with *non-smooth* objectives. | ||
|
||
|
||
Let's start first by generating a toy dataset and splitting it to train and test sets. For that, we will use scikit-learn make_regression | ||
|
||
.. code:: python | ||
# imports | ||
from sklearn.datasets import make_regression | ||
from sklearn.model_selection import train_test_split | ||
# generate toy data | ||
X, y = make_regression(n_samples=100, n_features=1000) | ||
# split data | ||
X_train, X_test, y_train, y_test = train_test_split(X, y) | ||
Then let's use ``rehline`` to fit a **quantile regression** at quantile level 0.75. | ||
|
||
.. code:: python | ||
# imports | ||
from sklearn.datasets import make_regression | ||
from sklearn.model_selection import train_test_split | ||
# generate toy data | ||
X, y = make_regression(n_samples=100, n_features=1000) | ||
# split data | ||
X_train, X_test, y_train, y_test = train_test_split(X, y) |
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Tutorials | ||
========= | ||
|
||
`ReHLine` is designed to address the empirical regularized ReLU-ReHU minimization problem, named *ReHLine optimization*, of the following form: | ||
|
||
.. math:: | ||
\min_{\mathbf{\beta} \in \mathbb{R}^d} \sum_{i=1}^n \sum_{l=1}^L \text{ReLU}( u_{li} \mathbf{x}_i^\intercal \mathbf{\beta} + v_{li}) + \sum_{i=1}^n \sum_{h=1}^H {\text{ReHU}}_{\tau_{hi}}( s_{hi} \mathbf{x}_i^\intercal \mathbf{\beta} + t_{hi}) + \frac{1}{2} \| \mathbf{\beta} \|_2^2, \ \text{ s.t. } \mathbf{A} \mathbf{\beta} + \mathbf{b} \geq \mathbf{0}, | ||
where :math:`\mathbf{U} = (u_{li}),\mathbf{V} = (v_{li}) \in \mathbb{R}^{L \times n}` | ||
and :math:`\mathbf{S} = (s_{hi}),\mathbf{T} = (t_{hi}),\mathbf{\tau} = (\tau_{hi}) \in \mathbb{R}^{H \times n}` | ||
are the ReLU-ReHU loss parameters, and :math:`(\mathbf{A},\mathbf{b})` are the constraint parameters. | ||
This formulation has a wide range of applications spanning various fields, including statistics, | ||
machine learning, computational biology, and social studies. | ||
Some popular examples include SVMs with fairness constraints (FairSVM), | ||
elastic net regularized quantile regression (ElasticQR), | ||
and ridge regularized Huber minimization (RidgeHuber). | ||
|
||
.. image:: ./figs/tab.png | ||
|
||
Solving Custom ERMs | ||
------------------- |
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