Skip to content

Commit 98fc670

Browse files
committed
Merge pull request scikit-learn#5157 from amueller/ridge_intercept_docs
[MRG] DOC mention intercept_ attribute in ridge docstring.
2 parents 7224c31 + 8a3d97d commit 98fc670

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

sklearn/linear_model/ridge.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,10 @@ class Ridge(_BaseRidge, RegressorMixin):
456456
coef_ : array, shape = [n_features] or [n_targets, n_features]
457457
Weight vector(s).
458458
459+
intercept_ : float | array, shape = (n_targets,)
460+
Independent term in decision function. Set to 0.0 if
461+
``fit_intercept = False``.
462+
459463
See also
460464
--------
461465
RidgeClassifier, RidgeCV, KernelRidge
@@ -554,6 +558,10 @@ class RidgeClassifier(LinearClassifierMixin, _BaseRidge):
554558
coef_ : array, shape = [n_features] or [n_classes, n_features]
555559
Weight vector(s).
556560
561+
intercept_ : float | array, shape = (n_targets,)
562+
Independent term in decision function. Set to 0.0 if
563+
``fit_intercept = False``.
564+
557565
See also
558566
--------
559567
Ridge, RidgeClassifierCV
@@ -875,7 +883,7 @@ def fit(self, X, y, sample_weight=None):
875883
raise ValueError("cv!=None and store_cv_values=True "
876884
" are incompatible")
877885
parameters = {'alpha': self.alphas}
878-
fit_params = {'sample_weight' : sample_weight}
886+
fit_params = {'sample_weight': sample_weight}
879887
gs = GridSearchCV(Ridge(fit_intercept=self.fit_intercept),
880888
parameters, fit_params=fit_params, cv=self.cv)
881889
gs.fit(X, y)
@@ -957,13 +965,13 @@ class RidgeCV(_BaseRidgeCV, RegressorMixin):
957965
coef_ : array, shape = [n_features] or [n_targets, n_features]
958966
Weight vector(s).
959967
960-
alpha_ : float
961-
Estimated regularization parameter.
962-
963968
intercept_ : float | array, shape = (n_targets,)
964969
Independent term in decision function. Set to 0.0 if
965970
``fit_intercept = False``.
966971
972+
alpha_ : float
973+
Estimated regularization parameter.
974+
967975
See also
968976
--------
969977
Ridge: Ridge regression
@@ -1028,6 +1036,10 @@ class RidgeClassifierCV(LinearClassifierMixin, _BaseRidgeCV):
10281036
coef_ : array, shape = [n_features] or [n_targets, n_features]
10291037
Weight vector(s).
10301038
1039+
intercept_ : float | array, shape = (n_targets,)
1040+
Independent term in decision function. Set to 0.0 if
1041+
``fit_intercept = False``.
1042+
10311043
alpha_ : float
10321044
Estimated regularization parameter
10331045

0 commit comments

Comments
 (0)