Skip to content

Commit 3d7112f

Browse files
committed
update doc
1 parent 0559db9 commit 3d7112f

File tree

12 files changed

+92
-93
lines changed

12 files changed

+92
-93
lines changed

doc/_templates/autoapi/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ API Reference
44
This page contains auto-generated API reference documentation [#f1]_.
55

66
.. toctree::
7-
:titlesonly:
87

98
/autoapi/rehline/index
109

doc/source/benchmark.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
📚 Benchmark
2-
============
1+
Benchmark
2+
=========
33

44
We have developed a benchmark for evaluating the performance of optimization methods, which is built on top of the `benchopt <https://github.com/benchopt/benchopt>`_. For those interested in reproducing the benchmark results presented in our paper, we provide a dedicated repository, `ReHLine-benchmark <https://github.com/softmin/ReHLine-benchmark>`_, which contains all the necessary resources and instructions.
55

doc/source/conf.py

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,7 @@
5757
'numpydoc',
5858
'nbsphinx',
5959
]
60-
autoapi_dirs = ['../../rehline']
61-
62-
# path to the examples scripts
63-
# sphinx_gallery_conf = {
64-
# 'examples_dirs': '../examples', # path to your example scripts
65-
# 'gallery_dirs': 'auto_examples', # path to where to save gallery generated output
66-
# }
60+
autoapi_dirs = ['../../rehline/']
6761

6862
autosummary_generate = True
6963
numpydoc_show_class_members = False
@@ -73,17 +67,6 @@
7367
# Add any paths that contain templates here, relative to this directory.
7468
templates_path = ['_templates']
7569

76-
77-
78-
not_document_data = 'sphinx_nbexamples.gallery_config'
79-
80-
example_gallery_config = dict(
81-
insert_bokeh='0.12.1',
82-
urls='https://github.com/softmin/ReHLine-python/tree/main/examples',
83-
)
84-
process_examples = not osp.exists(osp.join(osp.dirname(__file__), 'examples'))
85-
86-
8770
# List of patterns, relative to source directory, that match files and
8871
# directories to ignore when looking for source files.
8972
# This pattern also affects html_static_path and html_extra_path.

doc/source/example.rst

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
1-
🌰 Example
2-
==========
1+
Example
2+
=======
33

4-
- SVM and FairSVM [colab: svm_]
4+
Example Gallery
5+
---------------
56

6-
.. _svm: https://colab.research.google.com/drive/1f_7t1t6FNxAooQOmpyhHCOVq0IKgMxe-?usp=sharing
7+
.. nblinkgallery::
8+
:caption: A few links
9+
:name: rst-link-gallery
710

8-
- Quantile Regression [colab: qt_]
11+
examples/ReHLine_QR
12+
examples/ReHLine_SVM_FairSVM
13+
14+
List of Examples
15+
----------------
16+
17+
.. toctree::
18+
:maxdepth: 0
19+
20+
examples/ReHLine_QR.ipynb
21+
examples/ReHLine_SVM_FairSVM.ipynb
22+
923

10-
.. _qt: https://colab.research.google.com/drive/1LwatjwjnMSB97eLVyuOiUY3sl3A3Ie__?usp=sharing
File renamed without changes.

doc/source/getting_started.rst

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
Getting started
2+
===============
3+
4+
This page provides a starter example to introduce users to the ``rehline`` package and showcase its primary features, facilitating exploration and familiarization.
5+
6+
To proceed, make sure that you have already installed ``rehline``:
7+
8+
.. code:: bash
9+
10+
pip install rehline
11+
12+
--------------------------------
13+
14+
``rehline`` is a generic solver for flexible machine learning Empirical Risk Minimization (ERM), particularly suited for formulations with *non-smooth* objectives.
15+
16+
17+
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
18+
19+
.. code:: python
20+
21+
# imports
22+
from sklearn.datasets import make_regression
23+
from sklearn.model_selection import train_test_split
24+
25+
# generate toy data
26+
X, y = make_regression(n_samples=100, n_features=1000)
27+
28+
# split data
29+
X_train, X_test, y_train, y_test = train_test_split(X, y)
30+
31+
Then let's use ``rehline`` to fit a **quantile regression** at quantile level 0.75.
32+
33+
.. code:: python
34+
35+
# imports
36+
from sklearn.datasets import make_regression
37+
from sklearn.model_selection import train_test_split
38+
39+
# generate toy data
40+
X, y = make_regression(n_samples=100, n_features=1000)
41+
42+
# split data
43+
X_train, X_test, y_train, y_test = train_test_split(X, y)

doc/source/index.rst

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
🦌 ReHLine
77
==========
88

9-
.. image:: logo.png
9+
.. image:: figs/logo.png
1010
:width: 18%
1111
:align: right
1212

@@ -52,38 +52,14 @@ The proposed **ReHLine** solver has appealing exhibits appealing properties:
5252
- The optimization algorithm has a provable **LINEAR** convergence rate, and the per-iteration computational complexity is **LINEAR** in the sample size.
5353

5454
🔨 Installation
55-
===============
55+
---------------
5656

5757
Install ``rehline`` using ``pip``
5858

5959
.. code:: bash
6060
6161
pip install rehline
6262
63-
See more details in `installation <./installation.rst>`_.
64-
65-
📮 Formulation
66-
--------------
67-
68-
`ReHLine` is designed to address the empirical regularized ReLU-ReHU minimization problem, named *ReHLine optimization*, of the following form:
69-
70-
.. math::
71-
72-
\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},
73-
74-
75-
where :math:`\mathbf{U} = (u_{li}),\mathbf{V} = (v_{li}) \in \mathbb{R}^{L \times n}`
76-
and :math:`\mathbf{S} = (s_{hi}),\mathbf{T} = (t_{hi}),\mathbf{\tau} = (\tau_{hi}) \in \mathbb{R}^{H \times n}`
77-
are the ReLU-ReHU loss parameters, and :math:`(\mathbf{A},\mathbf{b})` are the constraint parameters.
78-
This formulation has a wide range of applications spanning various fields, including statistics,
79-
machine learning, computational biology, and social studies.
80-
Some popular examples include SVMs with fairness constraints (FairSVM),
81-
elastic net regularized quantile regression (ElasticQR),
82-
and ridge regularized Huber minimization (RidgeHuber).
83-
84-
.. image:: ./figs/tab.png
85-
86-
8763
Reference
8864
---------
8965
If you use this code please star 🌟 the repository and cite the following paper:
@@ -99,11 +75,8 @@ If you use this code please star 🌟 the repository and cite the following pape
9975
10076
10177
.. toctree::
102-
:maxdepth: 0
78+
:maxdepth: 2
10379
:hidden:
10480

105-
getting_started
106-
tutorials
107-
installation
108-
examples/index
81+
example
10982
benchmark

doc/source/installation.rst

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)