Skip to content

Commit

Permalink
DOC Adding p-value discussion to linear model docs (scikit-learn#14767)
Browse files Browse the repository at this point in the history
  • Loading branch information
nityamd authored and rth committed Aug 26, 2019
1 parent 628f34f commit 7fa78cf
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions doc/modules/linear_model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Ordinary Least Squares Complexity

The least squares solution is computed using the singular value
decomposition of X. If X is a matrix of shape `(n_samples, n_features)`
this method has a cost of
this method has a cost of
:math:`O(n_{\text{samples}} n_{\text{features}}^2)`, assuming that
:math:`n_{\text{samples}} \geq n_{\text{features}}`.

Expand Down Expand Up @@ -430,7 +430,7 @@ between the features.

The advantages of LARS are:

- It is numerically efficient in contexts where the number of features
- It is numerically efficient in contexts where the number of features
is significantly greater than the number of samples.

- It is computationally just as fast as forward selection and has
Expand Down Expand Up @@ -732,9 +732,9 @@ classifier. In this model, the probabilities describing the possible outcomes
of a single trial are modeled using a
`logistic function <https://en.wikipedia.org/wiki/Logistic_function>`_.

Logistic regression is implemented in :class:`LogisticRegression`.
This implementation can fit binary, One-vs-Rest, or multinomial logistic
regression with optional :math:`\ell_1`, :math:`\ell_2` or Elastic-Net
Logistic regression is implemented in :class:`LogisticRegression`.
This implementation can fit binary, One-vs-Rest, or multinomial logistic
regression with optional :math:`\ell_1`, :math:`\ell_2` or Elastic-Net
regularization.

.. note::
Expand Down Expand Up @@ -869,6 +869,14 @@ with 'log' loss, which might be even faster but requires more tuning.
thus be used to perform feature selection, as detailed in
:ref:`l1_feature_selection`.

.. note:: **P-value estimation**

It is possible to obtain the p-values and confidence intervals for
coefficients in cases of regression without penalization. The `statsmodels
package <https://pypi.org/project/statsmodels/>` natively supports this.
Within sklearn, one could use bootstrapping instead as well.


:class:`LogisticRegressionCV` implements Logistic Regression with built-in
cross-validation support, to find the optimal `C` and `l1_ratio` parameters
according to the ``scoring`` attribute. The "newton-cg", "sag", "saga" and
Expand Down

0 comments on commit 7fa78cf

Please sign in to comment.