diff --git a/doc/common_pitfalls.rst b/doc/common_pitfalls.rst index dc912d4ea3155..77341047857b5 100644 --- a/doc/common_pitfalls.rst +++ b/doc/common_pitfalls.rst @@ -243,7 +243,7 @@ Some scikit-learn objects are inherently random. These are usually estimators splitters (e.g. :class:`~sklearn.model_selection.KFold`). The randomness of these objects is controlled via their `random_state` parameter, as described in the :term:`Glossary `. This section expands on the glossary -entry, and describes good practices and common pitfalls w.r.t. to this +entry, and describes good practices and common pitfalls w.r.t. this subtle parameter. .. note:: Recommendation summary diff --git a/sklearn/base.py b/sklearn/base.py index 60313bf61d7d7..379c3143a8e43 100644 --- a/sklearn/base.py +++ b/sklearn/base.py @@ -681,7 +681,7 @@ def score(self, X, y, sample_weight=None): Returns ------- score : float - Mean accuracy of ``self.predict(X)`` wrt. `y`. + Mean accuracy of ``self.predict(X)`` w.r.t. `y`. """ from .metrics import accuracy_score @@ -725,7 +725,7 @@ def score(self, X, y, sample_weight=None): Returns ------- score : float - :math:`R^2` of ``self.predict(X)`` wrt. `y`. + :math:`R^2` of ``self.predict(X)`` w.r.t. `y`. Notes ----- diff --git a/sklearn/dummy.py b/sklearn/dummy.py index 826b9f7fd1979..961c6aa4de9a5 100644 --- a/sklearn/dummy.py +++ b/sklearn/dummy.py @@ -435,7 +435,7 @@ def score(self, X, y, sample_weight=None): Returns ------- score : float - Mean accuracy of self.predict(X) wrt. y. + Mean accuracy of self.predict(X) w.r.t. y. """ if X is None: X = np.zeros(shape=(len(y), 1)) @@ -667,7 +667,7 @@ def score(self, X, y, sample_weight=None): Returns ------- score : float - R^2 of `self.predict(X)` wrt. y. + R^2 of `self.predict(X)` w.r.t. y. """ if X is None: X = np.zeros(shape=(len(y), 1)) diff --git a/sklearn/linear_model/_glm/_newton_solver.py b/sklearn/linear_model/_glm/_newton_solver.py index d624d1399b1b9..6a2985a870e9c 100644 --- a/sklearn/linear_model/_glm/_newton_solver.py +++ b/sklearn/linear_model/_glm/_newton_solver.py @@ -88,7 +88,7 @@ class NewtonSolver(ABC): Newton step. gradient : ndarray of shape coef.shape - Gradient of the loss wrt. the coefficients. + Gradient of the loss w.r.t. the coefficients. gradient_old : ndarray of shape coef.shape Gradient of previous iteration. diff --git a/sklearn/linear_model/_logistic.py b/sklearn/linear_model/_logistic.py index 0d0da3983c664..6680d60cb4b1c 100644 --- a/sklearn/linear_model/_logistic.py +++ b/sklearn/linear_model/_logistic.py @@ -2087,7 +2087,7 @@ def score(self, X, y, sample_weight=None): Returns ------- score : float - Score of self.predict(X) wrt. y. + Score of self.predict(X) w.r.t. y. """ scoring = self.scoring or "accuracy" scoring = get_scorer(scoring) diff --git a/sklearn/model_selection/_split.py b/sklearn/model_selection/_split.py index fa83afa6378c7..5c3854cfc9d3b 100644 --- a/sklearn/model_selection/_split.py +++ b/sklearn/model_selection/_split.py @@ -2164,8 +2164,8 @@ def split(self, X, y, groups=None): def _validate_shuffle_split(n_samples, test_size, train_size, default_test_size=None): """ - Validation helper to check if the test/test sizes are meaningful wrt to the - size of the data (n_samples) + Validation helper to check if the test/test sizes are meaningful w.r.t. the + size of the data (n_samples). """ if test_size is None and train_size is None: test_size = default_test_size diff --git a/sklearn/neighbors/_lof.py b/sklearn/neighbors/_lof.py index bf4e5e6d12069..90b3b0aa3d8ce 100644 --- a/sklearn/neighbors/_lof.py +++ b/sklearn/neighbors/_lof.py @@ -240,7 +240,7 @@ def fit_predict(self, X, y=None): ---------- X : {array-like, sparse matrix} of shape (n_samples, n_features), default=None The query sample or samples to compute the Local Outlier Factor - w.r.t. to the training samples. + w.r.t. the training samples. y : Ignored Not used, present for API consistency by convention. @@ -343,7 +343,7 @@ def predict(self, X=None): ---------- X : {array-like, sparse matrix} of shape (n_samples, n_features) The query sample or samples to compute the Local Outlier Factor - w.r.t. to the training samples. + w.r.t. the training samples. Returns ------- @@ -361,7 +361,7 @@ def _predict(self, X=None): ---------- X : {array-like, sparse matrix} of shape (n_samples, n_features), default=None The query sample or samples to compute the Local Outlier Factor - w.r.t. to the training samples. If None, makes prediction on the + w.r.t. the training samples. If None, makes prediction on the training data without considering them as their own neighbors. Returns diff --git a/sklearn/neighbors/_quad_tree.pyx b/sklearn/neighbors/_quad_tree.pyx index cb2e77ac3307c..cce804b1724a5 100644 --- a/sklearn/neighbors/_quad_tree.pyx +++ b/sklearn/neighbors/_quad_tree.pyx @@ -426,7 +426,7 @@ cdef class _QuadTree: # Check whether we can use this node as a summary # It's a summary node if the angular size as measured from the point - # is relatively small (w.r.t. to theta) or if it is a leaf node. + # is relatively small (w.r.t. theta) or if it is a leaf node. # If it can be summarized, we use the cell center of mass # Otherwise, we go a higher level of resolution and into the leaves. if cell.is_leaf or (