Skip to content

Commit f5057f6

Browse files
amuellerrth
authored andcommitted
DOC some attribute documentation (scikit-learn#14459)
1 parent e070b74 commit f5057f6

File tree

14 files changed

+83
-3
lines changed

14 files changed

+83
-3
lines changed

sklearn/cluster/k_means_.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,7 +853,7 @@ class KMeans(BaseEstimator, ClusterMixin, TransformerMixin):
853853
converging (see ``tol`` and ``max_iter``), these will not be
854854
consistent with ``labels_``.
855855
856-
labels_ :
856+
labels_ : array, shape (n_samples,)
857857
Labels of each point
858858
859859
inertia_ : float

sklearn/cluster/spectral.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ class SpectralClustering(BaseEstimator, ClusterMixin):
373373
Affinity matrix used for clustering. Available only if after calling
374374
``fit``.
375375
376-
labels_ :
376+
labels_ : array, shape (n_samples,)
377377
Labels of each point
378378
379379
Examples

sklearn/decomposition/factor_analysis.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ class FactorAnalysis(BaseEstimator, TransformerMixin):
107107
n_iter_ : int
108108
Number of iterations run.
109109
110+
mean_ : array, shape (n_features,)
111+
Per-feature empirical mean, estimated from the training set.
112+
110113
Examples
111114
--------
112115
>>> from sklearn.datasets import load_digits

sklearn/ensemble/gradient_boosting.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,6 +2034,9 @@ class GradientBoostingClassifier(BaseGradientBoosting, ClassifierMixin):
20342034
The collection of fitted sub-estimators. ``loss_.K`` is 1 for binary
20352035
classification, otherwise n_classes.
20362036
2037+
classes_ : array of shape = [n_classes]
2038+
The classes labels.
2039+
20372040
Notes
20382041
-----
20392042
The features are always randomly permuted at each split. Therefore,

sklearn/linear_model/passive_aggressive.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ class PassiveAggressiveClassifier(BaseSGDClassifier):
124124
The actual number of iterations to reach the stopping criterion.
125125
For multiclass fits, it is the maximum over every binary fit.
126126
127+
classes_ : array of shape = (n_classes,)
128+
The unique classes labels.
129+
130+
t_ : int
131+
Number of weight updates performed during training.
132+
Same as ``(n_iter_ * n_samples)``.
133+
127134
Examples
128135
--------
129136
>>> from sklearn.linear_model import PassiveAggressiveClassifier
@@ -349,6 +356,10 @@ class PassiveAggressiveRegressor(BaseSGDRegressor):
349356
n_iter_ : int
350357
The actual number of iterations to reach the stopping criterion.
351358
359+
t_ : int
360+
Number of weight updates performed during training.
361+
Same as ``(n_iter_ * n_samples)``.
362+
352363
Examples
353364
--------
354365
>>> from sklearn.linear_model import PassiveAggressiveRegressor

sklearn/linear_model/perceptron.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ class Perceptron(BaseSGDClassifier):
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,)
112+
The unique classes labels.
113+
114+
t_ : int
115+
Number of weight updates performed during training.
116+
Same as ``(n_iter_ * n_samples)``.
117+
111118
Notes
112119
-----
113120

sklearn/linear_model/ridge.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,9 @@ class RidgeClassifier(LinearClassifierMixin, _BaseRidge):
865865
Actual number of iterations for each target. Available only for
866866
sag and lsqr solvers. Other solvers will return None.
867867
868+
classes_ : array of shape = [n_classes]
869+
The classes labels.
870+
868871
Examples
869872
--------
870873
>>> from sklearn.datasets import load_breast_cancer
@@ -1772,6 +1775,9 @@ class RidgeClassifierCV(LinearClassifierMixin, _BaseRidgeCV):
17721775
alpha_ : float
17731776
Estimated regularization parameter
17741777
1778+
classes_ : array of shape = [n_classes]
1779+
The classes labels.
1780+
17751781
Examples
17761782
--------
17771783
>>> from sklearn.datasets import load_breast_cancer

sklearn/linear_model/stochastic_gradient.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -895,6 +895,12 @@ class SGDClassifier(BaseSGDClassifier):
895895
896896
loss_function_ : concrete ``LossFunction``
897897
898+
classes_ : array of shape = [n_classes]
899+
900+
t_ : int
901+
Number of weight updates performed during training.
902+
Same as ``(n_iter_ * n_samples)``.
903+
898904
Examples
899905
--------
900906
>>> import numpy as np
@@ -1485,6 +1491,10 @@ class SGDRegressor(BaseSGDRegressor):
14851491
n_iter_ : int
14861492
The actual number of iterations to reach the stopping criterion.
14871493
1494+
t_ : int
1495+
Number of weight updates performed during training.
1496+
Same as ``(n_iter_ * n_samples)``.
1497+
14881498
Examples
14891499
--------
14901500
>>> import numpy as np

sklearn/manifold/spectral_embedding_.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,9 @@ class SpectralEmbedding(BaseEstimator):
396396
affinity_matrix_ : array, shape = (n_samples, n_samples)
397397
Affinity_matrix constructed from samples or precomputed.
398398
399+
n_neighbors_ : int
400+
Number of nearest neighbors effectively used.
401+
399402
Examples
400403
--------
401404
>>> from sklearn.datasets import load_digits

sklearn/naive_bayes.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ class labels known to the classifier
145145
epsilon_ : float
146146
absolute additive value to variances
147147
148+
classes_ : array-like, shape (n_classes,)
149+
Unique class labels.
150+
148151
Examples
149152
--------
150153
>>> import numpy as np
@@ -690,6 +693,9 @@ class MultinomialNB(BaseDiscreteNB):
690693
during fitting. This value is weighted by the sample weight when
691694
provided.
692695
696+
classes_ : array-like, shape (n_classes,)
697+
Unique class labels.
698+
693699
Examples
694700
--------
695701
>>> import numpy as np
@@ -794,6 +800,9 @@ class ComplementNB(BaseDiscreteNB):
794800
Number of samples encountered for each feature during fitting. This
795801
value is weighted by the sample weight when provided.
796802
803+
classes_ : array of shape = [n_classes]
804+
The classes labels.
805+
797806
Examples
798807
--------
799808
>>> import numpy as np
@@ -899,6 +908,10 @@ class BernoulliNB(BaseDiscreteNB):
899908
during fitting. This value is weighted by the sample weight when
900909
provided.
901910
911+
classes_ : array of shape = [n_classes]
912+
The classes labels.
913+
914+
902915
Examples
903916
--------
904917
>>> import numpy as np

0 commit comments

Comments
 (0)