8000 DOC reorganize API Ref of linear models (#15115) · crankycoder/scikit-learn@6a8b3d4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6a8b3d4

Browse files
NicolasHugrth
authored andcommitted
DOC reorganize API Ref of linear models (scikit-learn#15115)
1 parent 45ac1ef commit 6a8b3d4

File tree

4 files changed

+87
-33
lines changed

4 files changed

+87
-33
lines changed

doc/modules/classes.rst

Lines changed: 82 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -749,58 +749,119 @@ Plotting
749749

750750
.. _linear_model_ref:
751751

752-
:mod:`sklearn.linear_model`: Generalized Linear Models
753-
======================================================
752+
:mod:`sklearn.linear_model`: Linear Models
753+
==========================================
754754

755755
.. automodule:: sklearn.linear_model
756756
:no-members:
757757
:no-inherited-members:
758758

759759
**User guide:** See the :ref:`linear_model` section for further details.
760760

761+
The following subsections are only rough guidelines: the same estimator can
762+
fall into multiple categories, depending on its parameters.
763+
761764
.. currentmodule:: sklearn
762765

766+
Linear classifiers
767+
------------------
768+
.. autosummary::
769+
:toctree: generated/
770+
:template: class.rst
771+
772+
linear_model.LogisticRegression
773+
linear_model.LogisticRegressionCV
774+
linear_model.PassiveAggressiveClassifier
775+
linear_model.Perceptron
776+
linear_model.RidgeClassifier
777+
linear_model.RidgeClassifierCV
778+
linear_model.SGDClassifier
779+
780+
Classical linear regressors
781+
---------------------------
782+
783+
.. autosummary::
784+
:toctree: generated/
785+
:template: class.rst
786+
787+
linear_model.LinearRegression
788+
linear_model.Ridge
789+
linear_model.RidgeCV
790+
linear_model.SGDRegressor
791+
792+
Regressors with variable selection
793+
----------------------------------
794+
795+
The following estimators have built-in variable selection fitting
796+
procedures, but any estimator using a L1 or elastic-net penalty also
797+
performs variable selection: typically :class:`~linear_model.SGDRegressor`
798+
or :class:`~sklearn.linear_model.SGDClassifier` with an appropriate penalty.
799+
763800
.. autosummary::
764801
:toctree: generated/
765802
:template: class.rst
766803

767-
linear_model.ARDRegression
768-
linear_model.BayesianRidge
769804
linear_model.ElasticNet
770805
linear_model.ElasticNetCV
771-
linear_model.HuberRegressor
772806
linear_model.Lars
773807
linear_model.LarsCV
774808
linear_model.Lasso
775809
linear_model.LassoCV
< 10000 code>776810
linear_model.LassoLars
777811
linear_model.LassoLarsCV
778812
linear_model.LassoLarsIC
779-
linear_model.LinearRegression
780-
linear_model.LogisticRegression
781-
linear_model.LogisticRegressionCV
782-
linear_model.MultiTaskLasso
783-
linear_model.MultiTaskElasticNet
784-
linear_model.MultiTaskLassoCV
785-
linear_model.MultiTaskElasticNetCV
786813
linear_model.OrthogonalMatchingPursuit
787814
linear_model.OrthogonalMatchingPursuitCV
788-
linear_model.PassiveAggressiveClassifier
789-
linear_model.PassiveAggressiveRegressor
790-
linear_model.Perceptron
815+
816+
Bayesian regressors
817+
-------------------
818+
819+
.. autosummary::
820+
:toctree: generated/
821+
:template: class.rst
822+
823+
linear_model.ARDRegression
824+
linear_model.BayesianRidge
825+
826+
Multi-task linear regressors with variable selection
827+
----------------------------------------------------
828+
829+
These estimators fit multiple regression problems (or tasks) jointly, while
830+
inducing sparse coefficients. While the inferred coefficients may differ
831+
between the tasks, they are constrained to agree on the features that are
832+
selected (non-zero coefficients).
833+
834+
.. autosummary::
835+
:toctree: generated/
836+
:template: class.rst
837+
838+
linear_model.MultiTaskElasticNet
839+
linear_model.MultiTaskElasticNetCV
840+
linear_model.MultiTaskLasso
841+
linear_model.MultiTaskLassoCV
842+
843+
Outlier-robust regressors
844+
-------------------------
845+
846+
Any estimator using the Huber loss would also be robust to outliers, e.g.
847+
:class:`~linear_model.SGDRegressor` with ``loss='huber'``.
848+
849+
.. autosummary::
850+
:toctree: generated/
851+
:template: class.rst
852+
853+
linear_model.HuberRegressor
791854
linear_model.RANSACRegressor
792-
linear_model.Ridge
793-
linear_model.RidgeClassifier
794-
linear_model.RidgeClassifierCV
795-
linear_model.RidgeCV
796-
linear_model.SGDClassifier
797-
linear_model.SGDRegressor
798855
linear_model.TheilSenRegressor
799856

857+
Miscellaneous
858+
-------------
859+
800860
.. autosummary::
801861
:toctree: generated/
802862
:template: function.rst
803863

864+
linear_model.PassiveAggressiveRegressor
804865
linear_model.enet_path
805866
linear_model.lars_path
806867
linear_model.lars_path_gram

doc/modules/linear_model.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _linear_model:
22

3-
=========================
4-
Generalized Linear Models
5-
=========================
3+
=============
4+
Linear Models
5+
=============
66

77
.. currentmodule:: sklearn.linear_model
88

sklearn/linear_model/__init__.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
"""
2-
The :mod:`sklearn.linear_model` module implements generalized linear models. It
3-
includes Ridge regression, Bayesian Regression, Lasso and Elastic Net
4-
estimators computed with Least Angle Regression and coordinate descent. It also
5-
implements Stochastic Gradient Descent related algorithms.
2+
The :mod:`sklearn.linear_model` module implements a variety of linear models.
63
"""
74

85
# See http://scikit-learn.sourceforge.net/modules/sgd.html and

sklearn/linear_model/ransac.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,7 @@ class RANSACRegressor(MetaEstimatorMixin, RegressorMixin,
5858
"""RANSAC (RANdom SAmple Consensus) algorithm.
5959
6060
RANSAC is an iterative algorithm for the robust estimation of parameters
61-
from a subset of inliers from the complete data set. More information can
62-
be found in the general documentation of linear models.
63-
64-
A detailed description of the algorithm can be found in the documentation
65-
of the ``linear_model`` sub-package.
61+
from a subset of inliers from the complete data set.
6662
6763
Read more in the :ref:`User Guide <ransac_regression>`.
6864

0 commit comments

Comments
 (0)
0