Skip to content

Commit a413f87

Browse files
committed
DOC minor fixes do docstrings, don't document deprecated parameters.
1 parent b3fbccc commit a413f87

File tree

5 files changed

+8
-19
lines changed

5 files changed

+8
-19
lines changed

sklearn/cluster/hierarchical.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ class AgglomerativeClustering(BaseEstimator, ClusterMixin):
643643
pooling_func : callable, default=np.mean
644644
This combines the values of agglomerated features into a single
645645
value, and should accept an array of shape [M, N] and the keyword
646-
argument `axis=1`, and reduce it to an array of size [M].
646+
argument ``axis=1``, and reduce it to an array of size [M].
647647
648648
Attributes
649649
----------
@@ -702,7 +702,7 @@ def fit(self, X):
702702
"work with euclidean distances." %
703703
(self.affinity, ))
704704

705-
if not self.linkage in _TREE_BUILDERS:
705+
if self.linkage not in _TREE_BUILDERS:
706706
raise ValueError("Unknown linkage type %s."
707707
"Valid options are %s" % (self.linkage,
708708
_TREE_BUILDERS.keys()))

sklearn/ensemble/gradient_boosting.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def update_terminal_regions(self, tree, X, y, residual, y_pred,
220220
The sample mask to be used.
221221
learning_rate : float, default=0.1
222222
learning rate shrinks the contribution of each tree by
223-
`learning_rate`.
223+
``learning_rate``.
224224
k : int, default 0
225225
The index of the estimator being updated.
226226

sklearn/feature_selection/rfe.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ class RFE(BaseEstimator, MetaEstimatorMixin, SelectorMixin):
6969
The mask of selected features.
7070
7171
ranking_ : array of shape [n_features]
72-
The feature ranking, such that `ranking_[i]` corresponds to the
72+
The feature ranking, such that ``ranking_[i]`` corresponds to the
7373
ranking position of the i-th feature. Selected (i.e., estimated
7474
best) features are assigned rank 1.
7575

sklearn/lda.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ def _solve_svd(self, X, y, store_covariance=False, tol=1.0e-4):
382382
rank = np.sum(S > tol * S[0])
383383
self.scalings_ = np.dot(scalings, V.T[:, :rank])
384384
coef = np.dot(self.means_ - self.xbar_, self.scalings_)
385-
self.intercept_ = (-0.5 * np.sum(coef**2, axis=1)
385+
self.intercept_ = (-0.5 * np.sum(coef ** 2, axis=1)
386386
+ np.log(self.priors_))
387387
self.coef_ = np.dot(coef, self.scalings_.T)
388388
self.intercept_ -= np.dot(self.xbar_, self.coef_.T)
@@ -397,12 +397,6 @@ def fit(self, X, y, store_covariance=False, tol=1.0e-4):
397397
398398
y : array, shape (n_samples,)
399399
Target values.
400-
401-
store_covariance : bool, optional
402-
Additionally compute class covariance matrix (default False).
403-
404-
tol : float, optional
405-
Threshold used for rank estimation.
406400
"""
407401
if store_covariance:
408402
warnings.warn("'store_covariance' was moved to the __init__()"

sklearn/linear_model/base.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class would be predicted.
194194
"""
195195
if not hasattr(self, 'coef_') or self.coef_ is None:
196196
raise NotFittedError("This %(name)s instance is not fitted"
197-
"yet"%{'name':type(self).__name__})
197+
"yet" % {'name': type(self).__name__})
198198

199199
X = check_array(X, accept_sparse='csr')
200200

@@ -266,7 +266,7 @@ def densify(self):
266266
self: estimator
267267
"""
268268
msg = "Estimator, %(name)s, must be fitted before densifying."
269-
check_is_fitted(self, "coef_", msg=msg)
269+
check_is_fitted(self, "coef_", msg=msg)
270270
if sp.issparse(self.coef_):
271271
self.coef_ = self.coef_.toarray()
272272
return self
@@ -296,7 +296,7 @@ def sparsify(self):
296296
self: estimator
297297
"""
298298
msg = "Estimator, %(name)s, must be fitted before sparsifying."
299-
check_is_fitted(self, "coef_", msg=msg)
299+
check_is_fitted(self, "coef_", msg=msg)
300300
self.coef_ = sp.csr_matrix(self.coef_)
301301
return self
302302

@@ -360,11 +360,6 @@ def fit(self, X, y, n_jobs=1):
360360
y : numpy array of shape [n_samples, n_targets]
361361
Target values
362362
363-
n_jobs : int, optional, default 1
364-
The number of jobs to use for the computation.
365-
If -1 all CPUs are used. This will only provide speedup for
366-
n_targets > 1 and sufficiently large problems.
367-
368363
Returns
369364
-------
370365
self : returns an instance of self.

0 commit comments

Comments
 (0)