Skip to content

Commit

Permalink
Merge pull request #107 from star-dust-ctrl/master
Browse files Browse the repository at this point in the history
fix some links, some math display error, some jupyter display error
  • Loading branch information
Luminite9 authored Jun 19, 2024
2 parents 2da8f19 + 2e2de6a commit 96bbf0b
Show file tree
Hide file tree
Showing 13 changed files with 71 additions and 220 deletions.
2 changes: 1 addition & 1 deletion docs/source/contribute/ContributeCode.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Document the Solver
The contribution is almost done. The remaining thing is add a document for this solver. A new solver need a brief introduction and some examples. Also note that the style of Python document is similar to `numpydoc <https://numpydoc.readthedocs.io/en/latest/format.html>`__.

The development of Python API's documentation mainly relies on
`Sphinx <https://pypi.org/project/Sphinx/>`__, `sphinx-gallery <https://pypi.org/project/sphinx-gallery/>`__ (support markdown for Sphinx), `sphinx-rtd-theme <https://pypi.org/project/sphinx-rtd-theme/>`__
`Sphinx <https://pypi.org/project/Sphinx/>`__, `sphinx-gallery <https://pypi.org/project/sphinx-gallery/>`__ (support markdown for Sphinx), `pydata-sphinx-theme <https://pydata-sphinx-theme.readthedocs.io>`__
(support “Read the Docs” theme for Sphinx) and so on. Please make sure all packages in :code:`docs/requirements.txt` have been installed by:

.. code:: bash
Expand Down
4 changes: 2 additions & 2 deletions docs/source/feature/Variants.rst
Original file line number Diff line number Diff line change
Expand Up @@ -194,9 +194,9 @@ A typical example is the Gaussian graphical model for continuous random variable
This feature significantly expands the application range of ``skscope`` by allowing it to cooperate with other powerful optimization toolkits in Python.
We will briefly introduce some examples:

- ``cvxpy``: an open source Python-embedded modeling language for convex optimization problems. Its `official website <https://www.cvxpy.org/>`__ provides powerful features (such as semi-definite programs).
- ``cvxpy``: an open source Python-embedded modeling language for convex optimization problems. Its `official website <https://www.cvxpy.org>`__ provides powerful features (such as semi-definite programs).

- ``scipy.optimize``: includes solvers for nonlinear problems, linear programming, constrained and nonlinear least-squares, root finding, and curve fitting. Its documentation can be found `here <https://docs.scipy.org/doc/scipy/reference/optimize.html/>`__.
- ``scipy.optimize``: includes solvers for nonlinear problems, linear programming, constrained and nonlinear least-squares, root finding, and curve fitting. Its documentation can be found `here <https://docs.scipy.org/doc/scipy/reference/optimize.html>`__.

Reference
---------------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,14 @@
"id": "7f5e5d54",
"metadata": {},
"source": [
"\n",
"## Logistic Regressions\n",
"------------\n",
"\n",
"## Logistic Regressions"
]
},
{
"cell_type": "markdown",
"id": "25f1338c",
"metadata": {},
"source": [
"### Part A, we would like to use an example to show how the sparse-constrained optimization for logistic regression works in our program."
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,14 +360,6 @@
"print(\"True parameter:\\n\", data.coef_)\n",
"print(\"Estimated parameter:\\n\", solver.params.reshape((p, m)))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "0192226d",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,6 @@
"print(\"Estimated parameter:\\n\", solver.params.reshape((p, m)))\n",
"print(\"True parameter:\\n\", coef)"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@
"\n",
"- The dimension of $y$ is $p=50$ and the sample size is $n=500$;\n",
"\n",
"- The true correlation (covariance) matrix $\\Sigma$ is constructed with is elements being $\\Sigma_{i,j}=0.6^{|i-j|}\\mathbb{I}_{\\{|i-j|\\leq 4\\}, i\\neq j}, $ and $\\Sigma_{ii}=1$;\n",
"- The true correlation (covariance) matrix $\\Sigma$ is constructed with is elements being $\\Sigma_{i,j}=0.6^{|i-j|}\\mathbf{1}_{\\{|i-j|\\leq 4\\}, i\\neq j}$, and $\\Sigma_{ii}=1$;\n",
"\n",
"- We first generate $\\log y$ from $\\mathcal{N}(0,\\Sigma)$ and then $y$ is generated as its exponential;\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/gallery/Miscellaneous/hsic-splicing.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"> Note: ``skscope`` also implemented an api [NonlinearSelection](../../../autoapi/skmodel.html#skscope.skmodel.NonlinearSelection) and now users can call it directly. "
"> Note: ``skscope`` also implemented an api [NonlinearSelection](../../autoapi/skmodel.html#skscope.skmodel.NonlinearSelection) and now users can call it directly. "
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
" Note: ``skscope`` also implemented an api [PortfolioSelection](../../../autoapi/skmodel.html#skscope.skmodel.PortfolioSelection) and now users can call it directly. "
" Note: ``skscope`` also implemented an api [PortfolioSelection](../../autoapi/skmodel.html#skscope.skmodel.PortfolioSelection) and now users can call it directly. "
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,9 +276,9 @@
"Here, $ L $ represents the maximized likelihood of the model, $ k $ is the number of parameters in the model, and \n",
"$\\gamma$ is an adjustable parameter.\n",
"\n",
"Similar to BIC, EBIC considers both model complexity and sample size in the penalty term. However, EBIC introduces an extra parameter $ \\gamma $, allowing for greater flexibility in the model selection process. By adjusting the value of $\\gamma $, a finer balance between goodness of fit and model complexity can be achieved. When $ \\gamma = 0 $, EBIC reduces to BIC.\n",
"Similar to BIC, EBIC considers both model complexity and sample size in the penalty term. However, EBIC introduces an extra parameter $\\gamma$, allowing for greater flexibility in the model selection process. By adjusting the value of $\\gamma$, a finer balance between goodness of fit and model complexity can be achieved. When $\\gamma = 0$, EBIC reduces to BIC.\n",
"\n",
"EBIC finds wide application in high-dimensional data analysis and model selection, especially in fitting sparse models or performing variable selection. By tuning the $ \\gamma $ parameter, more precise model selection tailored to the specific characteristics of the problem can be achieved, thereby enhancing the flexibility and accuracy of model selection.\n",
"EBIC finds wide application in high-dimensional data analysis and model selection, especially in fitting sparse models or performing variable selection. By tuning the $\\gamma$ parameter, more precise model selection tailored to the specific characteristics of the problem can be achieved, thereby enhancing the flexibility and accuracy of model selection.\n",
"\n",
"EBIC can be applied to various models:\n",
"\n",
Expand Down
113 changes: 22 additions & 91 deletions docs/source/gallery/SurvivalModels/competing-risk-model.ipynb

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions docs/source/userguide/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Further reading

- `JAX library <https://jax.readthedocs.io/en/latest/index.html>`__

- A bunch of `machine learning methods <gallery/index.html>`__ implemented on the ``skscope``
- A bunch of `machine learning methods <../gallery/index.html>`__ implemented on the ``skscope``

- More `advanced features <../feature/index.html>`__ implemented in ``skscope``

Expand All @@ -158,4 +158,4 @@ Footnotes
.. [*] If you know nothing about ``numpy``, we can turn to `this introduction <https://numpy.org/doc/stable/user/whatisnumpy.html>`__.
.. [*] We skip the algorithmic detail about ``scopeSolver``. Please turn the paper "sparsity-constrained optimization via splicing iteration" if your are interested in.
.. [*] We skip the algorithmic detail about ``scopeSolver``. Please turn to the paper "sparsity-constrained optimization via splicing iteration" if your are interested in.
12 changes: 6 additions & 6 deletions docs/source/userguide/whatscope.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,39 @@ What is ``skscope``?

``skscope`` is a powerful open-source Python package specifically developed to tackle sparsity-constrained optimization (SCO) problems with utmost efficiency. With SCO's broad applicability in machine learning, statistics, signal processing, and other related domains, ``skscope`` can find extensive usage in these fields. For example, it excels in solving classic SCO problems like variable selection (also known as feature selection or compress sensing). Even more impressively, it goes beyond that and handles a diverse range of intriguing real-world problems:

1. `Robust variable selection <gallery/LinearModelAndVariants/robust-regression.html>`__
1. `Robust variable selection <../gallery/LinearModelAndVariants/robust-regression.html>`__

.. image:: figure/variable_selection.png
:width: 300
:align: center

2. `Nonlinear variable selection <gallery/Miscellaneous/hsic-splicing.html>`__
2. `Nonlinear variable selection <../gallery/Miscellaneous/hsic-splicing.html>`__

.. image:: figure/nonlinear_variable_selection.png
:width: 666
:align: center


3. `Spatial trend filtering <gallery/FusionModels/spatial-trend-filtering.html>`__
3. `Spatial trend filtering <../gallery/FusionModels/spatial-trend-filtering.html>`__

.. image:: figure/trend_filter.png
:width: 666
:align: center

4. `Network reconstruction <gallery/GraphicalModels/sparse-gaussian-precision.html>`__
4. `Network reconstruction <../gallery/GraphicalModels/sparse-gaussian-precision.html>`__

.. image:: figure/precision_matrix.png
:width: 666
:align: center

5. `Portfolio selection <gallery/Miscellaneous/portfolio-selection.html>`__
5. `Portfolio selection <../gallery/Miscellaneous/portfolio-selection.html>`__

.. image:: figure/portfolio_selection.png
:width: 300
:align: center


These above examples represent just a glimpse of the practical problems that ``skscope`` can effectively address. With its efficient optimization algorithms and versatility, ``skscope`` proves to be an invaluable tool for a wide range of disciplines. Currently, we offer over 20 examples in our comprehensive `example gallery <gallery/index.html>`__.
These above examples represent just a glimpse of the practical problems that ``skscope`` can effectively address. With its efficient optimization algorithms and versatility, ``skscope`` proves to be an invaluable tool for a wide range of disciplines. Currently, we offer over 20 examples in our comprehensive `example gallery <../gallery/index.html>`__.


.. How does ``skscope`` work?
Expand Down

0 comments on commit 96bbf0b

Please sign in to comment.