8000 Update ridge.py · scikit-learn/scikit-learn@8441bec · GitHub
[go: up one dir, main page]

Skip to content

Commit 8441bec

Browse files
authored
Update ridge.py
`default None` -> `default=None`
1 parent e51701d commit 8441bec

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

sklearn/linear_model/ridge.py

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ def ridge_regression(X, y, alpha, sample_weight=None, solver='auto',
262262
assumed to be specific to the targets. Hence they must correspond in
263263
number.
264264
265-
sample_weight : float or numpy array of shape [n_samples], default None
265+
sample_weight : float or numpy array of shape [n_samples], default=None
266266
Individual weights for each sample. If sample_weight is not None and
267267
solver='auto', the solver will be set to 'cholesky'.
268268
@@ -314,10 +314,10 @@ def ridge_regression(X, y, alpha, sample_weight=None, solver='auto',
314314
by scipy.sparse.linalg. For 'sag' and saga solver, the default value is
315315
1000.
316316
317-
tol : float, default 1e-3
317+
tol : float, default=1e-3
318318
Precision of the solution.
319319
320-
verbose : int, default 0
320+
verbose : int, default=0
321321
Verbosity level. Setting verbose > 0 will display additional
322322
information depending on the solver used.
323323
@@ -328,21 +328,21 @@ def ridge_regression(X, y, alpha, sample_weight=None, solver='auto',
328328
generator; If None, the random number generator is the RandomState
329329
instance used by `np.random`. Used when ``solver`` == 'sag'.
330330
331-
return_n_iter : boolean, default False
331+
return_n_iter : boolean, default=False
332332
If True, the method also returns `n_iter`, the actual number of
333333
iteration performed by the solver.
334334
335335
.. versionadded:: 0.17
336336
337-
return_intercept : boolean, default False
337+
return_intercept : boolean, default=False
338338
If True and if X is sparse, the method also returns the intercept,
339339
and the solver is automatically changed to 'sag'. This is only a
340340
temporary fix for fitting the intercept with sparse data. For dense
341341
data, use sklearn.linear_model._preprocess_data before your regression.
342342
343343
.. versionadded:: 0.17
344344
345-
check_input : boolean, default True
345+
check_input : boolean, default=True
346346
If False, the input arrays X and y will not be checked.
347347
348348
.. versionadded:: 0.21
@@ -619,7 +619,7 @@ class Ridge(_BaseRidge, RegressorMixin):
619619
620620
Parameters
621621
----------
622-
alpha : {float, array-like}, shape (n_targets), default 1.0
622+
alpha : {float, array-like}, shape (n_targets), default=1.0
623623
Regularization strength; must be a positive float. Regularization
624624
improves the conditioning of the problem and reduces the variance of
625625
the estimates. Larger values specify stronger regularization.
@@ -628,28 +628,28 @@ class Ridge(_BaseRidge, RegressorMixin):
628628
assumed to be specific to the targets. Hence they must correspond in
629629
number.
630630
631-
fit_intercept : bool, default True
631+
fit_intercept : bool, default=True
632632
Whether to calculate the intercept for this model. If set
633633
to false, no intercept will be used in calculations
634634
(e.g. data is expected to be already centered).
635635
636-
normalize : boolean, optional, default False
636+
normalize : boolean, optional, default=False
637637
This parameter is ignored when ``fit_intercept`` is set to False.
638638
If True, the regressors X will be normalized before regression by
639639
subtracting the mean and dividing by the l2-norm.
640640
If you wish to standardize, please use
641641
:class:`sklearn.preprocessing.StandardScaler` before calling ``fit``
642642
on an estimator with ``normalize=False``.
643643
644-
copy_X : boolean, optional, default True
644+
copy_X : boolean, optional, default=True
645645
If True, X will be copied; else, it may be overwritten.
646646
647647
max_iter : int, optional
648648
Maximum number of iterations for conjugate gradient solver.
649649
For 'sparse_cg' and 'lsqr' solvers, the default value is determined
650650
by scipy.sparse.linalg. For 'sag' solver, the default value is 1000.
651651
652-
tol : float, default 1e-3
652+
tol : float, default=1e-3
653653
Precision of the solution.
654654
655655
solver : {'auto', 'svd', 'cholesky', 'lsqr', 'sparse_cg', 'sag', 'saga'}
@@ -771,34 +771,34 @@ class RidgeClassifier(LinearClassifierMixin, _BaseRidge):
771771
772772
Parameters
773773
----------
774-
alpha : float, default 1.0
774+
alpha : float, default=1.0
775775
Regularization strength; must be a positive float. Regularization
776776
improves the conditioning of the problem and reduces the variance of
777777
the estimates. Larger values specify stronger regularization.
778778
Alpha corresponds to ``C^-1`` in other linear models such as
779779
LogisticRegression or LinearSVC.
780780
781-
fit_intercept : bool, default True
781+
fit_intercept : bool, default=True
782782
Whether to calculate the intercept for this model. If set to false, no
783783
intercept will be used in calculations (e.g. data is expected to be
784784
already centered).
785785
786-
normalize : boolean, optional, default False
786+
normalize : boolean, optional, default=False
787787
This parameter is ignored when ``fit_intercept`` is set to False.
788788
If True, the regressors X will be normalized before regression by
789789
subtracting the mean and dividing by the l2-norm.
790790
If you wish to standardize, please use
791791
:class:`sklearn.preprocessing.StandardScaler` before calling ``fit``
792792
on an estimator with ``normalize=False``.
793793
794-
copy_X : boolean, optional, default True
794+
copy_X : boolean, optional, default=True
795795
If True, X will be copied; else, it may be overwritten.
796796
797797
max_iter : int, optional
798798
Maximum number of iterations for conjugate gradient solver.
799799
The default value is determined by scipy.sparse.linalg.
800800
801-
tol : float, default 1e-3
801+
tol : float, default=1e-3
802802
Precision of the solution.
803803
804804
class_weight : dict or 'balanced', optional
@@ -843,7 +843,7 @@ class RidgeClassifier(LinearClassifierMixin, _BaseRidge):
843843
.. versionadded:: 0.19
844844
SAGA solver.
845845
846-
random_state : int, RandomState instance or None, optional, default None
846+
random_state : int, RandomState instance or None, optional, default=None
847847
The seed of the pseudo random number generator to use when shuffling
848848
the data. If int, random_state is the seed used by the random number
849849
generator; If RandomState instance, random_state is the random number
@@ -906,7 +906,7 @@ def fit(self, X, y, sample_weight=None):
906906
y : array-like, shape = [n_samples]
907907
Target values
908908
909-
sample_weight : {float, numpy array}, shape (n_samples), default None
909+
sample_weight : {float, numpy array}, shape (n_samples), default=None
910910
Sample weight.
911911
912912
.. versionadded:: 0.17
@@ -1586,7 +1586,7 @@ class RidgeCV(_BaseRidgeCV, RegressorMixin):
15861586
15871587
Parameters
15881588
----------
1589-
alphas : numpy array of shape [n_alphas], default (0.1, 1.0, 10.0)
1589+
alphas : numpy array of shape [n_alphas], default=(0.1, 1.0, 10.0)
15901590
Array of alpha values to try.
15911591
Regularization strength; must be a positive float. Regularization
15921592
improves the conditioning of the problem and reduces the variance of
@@ -1595,20 +1595,20 @@ class RidgeCV(_BaseRidgeCV, RegressorMixin):
15951595
LogisticRegression or LinearSVC.
15961596
If using generalized cross-validation, alphas must be positive.
15971597
1598-
fit_intercept : bool, default True
1598+
fit_intercept : bool, default=True
15991599
Whether to calculate the intercept for this model. If set
16001600
to false, no intercept will be used in calculations
16011601
(e.g. data is expected to be already centered).
16021602
1603-
normalize : boolean, optional, default False
1603+
normalize : boolean, optional, default=False
16041604
This parameter is ignored when ``fit_intercept`` is set to False.
16051605
If True, the regressors X will be normalized before regression by
16061606
subtracting the mean and dividing by the l2-norm.
16071607
If you wish to standardize, please use
16081608
:class:`sklearn.preprocessing.StandardScaler` before calling ``fit``
16091609
on an estimator with ``normalize=False``.
16101610
1611-
scoring : string, callable or None, optional, default: None
1611+
scoring : string, callable or None, optional, default=None
16121612
A string (see model evaluation documentation) or
16131613
a scorer callable object / function with signature
16141614
``scorer(estimator, X, y)``.
@@ -1700,28 +1700,28 @@ class RidgeClassifierCV(LinearClassifierMixin, _BaseRidgeCV):
17001700
17011701
Parameters
17021702
----------
1703-
alphas : numpy array of shape [n_alphas], default (0.1, 1.0, 10.0)
1703+
alphas : numpy array of shape [n_alphas], default=(0.1, 1.0, 10.0)
17041704
Array of alpha values to try.
17051705
Regularization strength; must be a positive float. Regularization
17061706
improves the conditioning of the problem and reduces the variance of
17071707
the estimates. Larger values specify stronger regularization.
17081708
Alpha corresponds to ``C^-1`` in other linear models such as
17091709
LogisticRegression or LinearSVC.
17101710
1711-
fit_intercept : bool, default True
1711+
fit_intercept : bool, default=True
17121712
Whether to calculate the intercept for this model. If set
17131713
to false, no intercept will be used in calculations
17141714
(e.g. data is expected to be already centered).
17151715
1716-
normalize : boolean, optional, default False
1716+
normalize : boolean, optional, default=False
17171717
This parameter is ignored when ``fit_intercept`` is set to False.
17181718
If True, the regressors X will be normalized before regression by
17191719
subtracting the mean and dividing by the l2-norm.
17201720
If you wish to standardize, please use
17211721
:class:`sklearn.preprocessing.StandardScaler` before calling ``fit``
17221722
on an estimator with ``normalize=False``.
17231723
1724-
scoring : string, callable or None, optional, default: None
1724+
scoring : string, callable or None, optional, default=None
17251725
A string (see model evaluation documentation) or
17261726
a scorer callable object / function with signature
17271727
``scorer(estimator, X, y)``.
@@ -1815,7 +1815,7 @@ def fit(self, X, y, sample_weight=None):
18151815
y : array-like, shape (n_samples,)
18161816
Target values. Will be cast to X's dtype if necessary
18171817
1818-
sample_weight : {float, numpy array}, shape (n_samples), default None
1818+
sample_weight : {float, numpy array}, shape (n_samples), default=None
18191819
Sample weight.
18201820
18211821
Returns

0 commit comments

Comments
 (0)
0