Skip to content

Commit 266a7e9

Browse files
authored
Merge pull request #472 from oooo26/master
Update document
2 parents c057806 + 8a964e8 commit 266a7e9

18 files changed

+58
-72
lines changed

docs/Changelog.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,25 @@
11
Changelog
22
=========
33

4-
Unreleased
5-
----------
4+
Version 0.4.6
5+
-------------
66

77
- R package
88
- Python package
99

10+
- Support `score` function for all GLM estimators.
1011
- Rearrange some arguments to improve legibility.
1112
Please check `here <https://abess.readthedocs.io/en/latest/Python-package/index.html>`__ for the latest API.
13+
- Better docstring, e.g. move important arguments to the front.
14+
- Combine `metrics.py` and `functions.py`.
1215

1316
- C++
1417

15-
- Support the base model for GLM. The Sparse GLM model can be implemented easilier.
18+
- Support the base model for GLM. The Sparse GLM model can be implemented much easilier.
1619
- Re-write logistic, poisson and gamma regression on the basis of GLM base model.
1720

1821
Versions 0.4.2 -- 0.4.5
19-
----------
22+
-----------------------
2023

2124
- R package
2225

@@ -52,7 +55,7 @@ Versions 0.4.2 -- 0.4.5
5255
`Junhao Huang <https://github.com/oooo26>`__!
5356

5457
Version 0.4.1
55-
----------
58+
-------------
5659

5760
- R package
5861

docs/Contributing/AfterCodeDeveloping.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
After Code Developing
2-
===========
2+
=====================
33

44
CodeFactor
55
----------

docs/Contributing/AppendixArchitecture.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Appendix: Architecture of **abess**
2-
========================
2+
===================================
33

44
In this page, we briefly introduce our core code of ``abess``, which is summarized in the Figure below.
55

docs/Contributing/Bug-NewFeatures.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Bug Report or New Feature Request
2-
============
2+
=================================
33

44
Bugs Report
55
-----------
@@ -27,4 +27,4 @@ When suggesting a new feature, please:
2727
- explain in detail how it would work.
2828
- keep the scope as narrow as possible, to make it easier to understand
2929
and implementation.
30-
- provide few important literatures if possible.
30+
- provide few important literatures if possible.

docs/Contributing/ContributeDocs.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
Contribute documentation
2-
============
2+
========================
33

44
.. _general development procedure:
55

66
General development procedure
7-
~~~~~~~~~~~~~~~~~
7+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
88

99
If you're a more experienced with the ``abess`` and are looking forward to
1010
improve your open source development skills, the next step up is to
@@ -77,14 +77,14 @@ parameters it requires, such as
7777
Also note that the style of Python document is similar to
7878
`numpydoc <https://numpydoc.readthedocs.io/en/latest/format.html>`__.
7979

80-
The development of Python API's documentation relies on
80+
The development of Python API's documentation mainly relies on
8181
`Sphinx <https://pypi.org/project/Sphinx/>`__,
82-
`nbsphinx <https://pypi.org/project/nbsphinx/>`__ (support jupyter
83-
notebook for Sphinx),
84-
`myst-parser <https://pypi.org/project/myst-parser/>`__ (support
82+
`sphinx-gallery <https://pypi.org/project/sphinx-gallery/>`__ (support
8583
markdown for Sphinx),
8684
`sphinx-rtd-theme <https://pypi.org/project/sphinx-rtd-theme/>`__
87-
(support “Read the Docs” theme for Sphinx). Make sure these packages
85+
(support “Read the Docs” theme for Sphinx) and so on.
86+
87+
Please make sure all packages in :code:`docs/requirements.txt`
8888
have been installed.
8989

9090
Tutorials
@@ -107,7 +107,7 @@ The development of the tutorial relies on `sphinix-gallery <https://pypi.org/pro
107107
.. _python document development:
108108

109109
Document development
110-
^^^^^^^^^
110+
^^^^^^^^^^^^^^^^^^^^
111111

112112
Before developing document, we presume that you have already complete the steps 1-3 described in `general development procedure`_,
113113
and you have installed necessary packages, including: ``sphinix-gallery``, ``Sphinx``, ``nbsphinx``, ``myst-parser``, ``sphinx-rtd-theme``.

docs/Contributing/ContributePyR.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Contribute Python/R code
2-
============
2+
========================
33

44
If you are a experienced programmer, you might want to help new features
55
development or bug fixing for the abess library. The preferred workflow

docs/Contributing/DevelopNewFeatures.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Develop New Features
2-
===============
2+
====================
33

44
In this tutorial, we will show you how to develop a new algorithm for specific best-subset problem with ``abess``'s procedure.
55

docs/Contributing/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
######################
1+
############
22
Contributing
3-
######################
3+
############
44

55
Contributions are welcome! No matter your current skills, it's possible
66
to make valuable contribution to the ``abess``.

docs/Tutorial/1-glm/plot_1_LinearRegression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
# Next, we present an example to show the ``abess`` package can get an optimal estimation.
2222
#
2323
# Toward optimality: adaptive best-subset selection
24-
# ^^^^^^^^^^^^^^^^^^^^^^
24+
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2525
#
2626
# Synthetic dataset
27-
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27+
# ~~~~~~~~~~~~~~~~~
2828
#
2929
# We generate a design matrix :math:`X` containing :math:`n = 300` observations and each observation has :math:`p = 1000` predictors.
3030
# The response variable :math:`y` is linearly related to the first, second, and fifth predictors in :math:`X`:

docs/Tutorial/1-glm/plot_4_CoxRegression.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"""
2-
==============
2+
=================================
33
Survival Analysis: Cox Regression
4-
==============
4+
=================================
55
"""
66
###############################################################################
77
# Cox Proportional Hazards Regression
@@ -49,7 +49,7 @@
4949
# which is independent of time.
5050
#
5151
# Lung Cancer Dataset Analysis
52-
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
52+
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5353
# We are going to apply best subset selection to the NCCTG Lung Cancer Dataset from https://www.kaggle.com/ukveteran/ncctg-lung-cancer-data.
5454
# This dataset consists of survival information of patients with advanced lung cancer from the North Central Cancer Treatment Group.
5555
# The proportional hazards model allows the analysis of survival data by regression modeling.
@@ -114,7 +114,6 @@
114114
# After fitting, the coefficients are stored in ``model.coef_``,
115115
# and the non-zero values indicate the variables used in our model.
116116

117-
118117
print(model.coef_)
119118

120119
# %%
@@ -175,10 +174,9 @@
175174
# the sample with the higher risk prediction will experience an event
176175
# before the other sample or belong to a higher binary class.
177176

178-
from abess.metrics import concordance_index_censored
179-
180-
cindex = concordance_index_censored(test[:, 1] == 2, test[:, 0], pred)
181-
print(cindex[0])
177+
test[:, 1] = test[:, 1] == 2
178+
cindex = model.score(test[:, 2:], test[:, :2])
179+
print(cindex)
182180

183181
# %%
184182
# On this dataset, the C-index is about 0.68.

0 commit comments

Comments
 (0)