8000 [MRG+1] DOC adding a warning on the relation between C and alpha (#7860) · scikit-learn/scikit-learn@8793ec9 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8793ec9

Browse files
dalmiaTomDLT
authored andcommitted
[MRG+1] DOC adding a warning on the relation between C and alpha (#7860)
* DOC adding a warning on the relation between C and alpha * DOC removing extra character * DOC: changes to the relation described * DOC fixing typo * DOC fixing typo * DOC fixing link to Ridge * DOC link enhancement * DOC fixing line length
1 parent 63583fe commit 8793ec9

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

doc/modules/linear_model.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,13 @@ They also tend to break when the problem is badly conditioned
266266

267267
* :ref:`sphx_glr_auto_examples_linear_model_plot_lasso_model_selection.py`
268268

269+
Comparison with the regularization parameter of SVM
270+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
271+
272+
The equivalence between ``alpha`` and the regularization parameter of SVM,
273+
``C`` is given by ``alpha = 1 / C`` or ``alpha = 1 / (n_samples * C)``,
274+
depending on the estimator and the exact objective function optimized by the
275+
model.
269276

270277
.. _multi_task_lasso:
271278

doc/modules/svm.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -600,8 +600,11 @@ The decision function is:
600600
.. note::
601601

602602
While SVM models derived from `libsvm`_ and `liblinear`_ use ``C`` as
603-
regularization parameter, most other estimators use ``alpha``. The relation
604-
between both is :math:`C = \frac{n\_samples}{alpha}`.
603+
regularization parameter, most other estimators use ``alpha``. The exact
604+
equivalence between the amount of regularization of two models depends on
605+
the exact objective function optimized by the model. For example, when the
606+
estimator used is :class:`sklearn.linear_model.Ridge <ridge>` regression,
607+
the relation between them is given as :math:`C = \frac{1}{alpha}`.
605608

606609
.. TODO multiclass case ?/
607610

0 commit comments

Comments
 (0)
0