8000 DOC Fix default values in Perceptron documentation (#15965) · scikit-learn/scikit-learn@86b4636 · GitHub
[go: up one dir, main page]

Skip to content

Commit 86b4636

Browse files
ankishbrth
authored andcommitted
DOC Fix default values in Perceptron documentation (#15965)
1 parent bbb21e2 commit 86b4636

File tree

2 files changed

+74
-71
lines changed

2 files changed

+74
-71
lines changed

sklearn/linear_model/_perceptron.py

+18-18
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ class Perceptron(BaseSGDClassifier):
1212
Parameters
1313
----------
1414
15-
penalty : None, 'l2' or 'l1' or 'elasticnet'
16-
The penalty (aka regularization term) to be used. Defaults to None.
15+
penalty : {'l2','l1','elasticnet'}, default=None
16+
The penalty (aka regularization term) to be used.
1717
18-
alpha : float
18+
alpha : float, default=0.0001
1919
Constant that multiplies the regularization term if regularization is
20-
used. Defaults to 0.0001
20+
used.
2121
22-
fit_intercept : bool
22+
fit_intercept : bool, default=True
2323
Whether the intercept should be estimated or not. If False, the
24-
data is assumed to be already centered. Defaults to True.
24+
data is assumed to be already centered.
2525
26-
max_iter : int, optional (default=1000)
26+
max_iter : int, default=1000
2727
The maximum number of passes over the training data (aka epochs).
2828
It only impacts the behavior in the ``fit`` method, and not the
2929
:meth:`partial_fit` method.
3030
3131
.. versionadded:: 0.19
3232
33-
tol : float or None, optional (default=1e-3)
33+
tol : float, default=1e-3
3434
The stopping criterion. If it is not None, the iterations will stop
3535
when (loss > previous_loss - tol).
3636
@@ -39,20 +39,20 @@ class Perceptron(BaseSGDClassifier):
3939
shuffle : bool, default=True
4040
Whether or not the training data should be shuffled after each epoch.
4141
42-
verbose : integer, default=0
42+
verbose : int, default=0
4343
The verbosity level
4444
45-
eta0 : double
46-
Constant by which the updates are multiplied. Defaults to 1.
45+
eta0 : double, default=1
46+
Constant by which the updates are multiplied.
4747
48-
n_jobs : int or None, optional (default=None)
48+
n_jobs : int, default=None
4949
The number of CPUs to use to do the OVA (One Versus All, for
5050
multi-class problems) computation.
5151
``None`` means 1 unless in a :obj:`joblib.parallel_backend` context.
5252
``-1`` means using all processors. See :term:`Glossary <n_jobs>`
5353
for more details.
5454
55-
random_state : int, RandomState instance or None, optional, default None
55+
random_state : int, RandomState instance, default=None
5656
The seed of the pseudo random number generator to use when shuffling
5757
the data. If int, random_state is the seed used by the random number
5858
generator; If RandomState instance, random_state is the random number
@@ -80,7 +80,7 @@ class Perceptron(BaseSGDClassifier):
8080
8181
.. versionadded:: 0.20
8282
83< 8000 /td>-
class_weight : dict, {class_label: weight} or "balanced" or None, optional
83+
class_weight : dict, {class_label: weight} or "balanced", default=None
8484
Preset for the class_weight fit parameter.
8585
8686
Weights associated with classes. If not given, all classes
@@ -97,18 +97,18 @@ class Perceptron(BaseSGDClassifier):
9797
9898
Attributes
9999
----------
100-
coef_ : array, shape = [1, n_features] if n_classes == 2 else [n_classes,\
101-
n_features]
100+
coef_ : ndarray of shape = [1, n_features] if n_classes == 2 else \
101+
[n_classes, n_features]
102102
Weights assigned to the features.
103103
104-
intercept_ : array, shape = [1] if n_classes == 2 else [n_classes]
104+
intercept_ : ndarray of shape = [1] if n_classes == 2 else [n_classes]
105105
Constants in decision function.
106106
107107
n_iter_ : int
108108
The actual number of iterations to reach the stopping criterion.
109109
For multiclass fits, it is the maximum over every binary fit.
110110
111-
classes_ : array of shape (n_classes,)
111+
classes_ : ndarray of shape (n_classes,)
112112
The unique classes labels.
113113
114114
t_ : int

0 commit comments

Comments
 (0)
0