Skip to content

Commit a189be8

Browse files
srowenHyukjinKwon
authored andcommitted
[MINOR][DOCS] Avoid some python docs where first sentence has "e.g." or similar
### What changes were proposed in this pull request? Avoid some python docs where first sentence has "e.g." or similar as the period causes the docs to show only half of the first sentence as the summary. ### Why are the changes needed? See for example https://spark.apache.org/docs/latest/api/python/reference/api/pyspark.ml.regression.LinearRegressionModel.html?highlight=linearregressionmodel#pyspark.ml.regression.LinearRegressionModel.summary where the method description is clearly truncated. ### Does this PR introduce _any_ user-facing change? Only changes docs. ### How was this patch tested? Manual testing of docs. Closes #32508 from srowen/TruncatedPythonDesc. Authored-by: Sean Owen <srowen@gmail.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
1 parent 78221bd commit a189be8

12 files changed

Lines changed: 24 additions & 24 deletions

File tree

python/pyspark/ml/classification.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -738,7 +738,7 @@ def intercept(self):
738738
@since("3.1.0")
739739
def summary(self):
740740
"""
741-
Gets summary (e.g. accuracy/precision/recall, objective history, total iterations) of model
741+
Gets summary (accuracy/precision/recall, objective history, total iterations) of model
742742
trained on the training set. An exception is thrown if `trainingSummary is None`.
743743
"""
744744
if self.hasSummary:
@@ -1237,7 +1237,7 @@ def interceptVector(self):
12371237
@since("2.0.0")
12381238
def summary(self):
12391239
"""
1240-
Gets summary (e.g. accuracy/precision/recall, objective history, total iterations) of model
1240+
Gets summary (accuracy/precision/recall, objective history, total iterations) of model
12411241
trained on the training set. An exception is thrown if `trainingSummary is None`.
12421242
"""
12431243
if self.hasSummary:
@@ -1843,7 +1843,7 @@ def trees(self):
18431843
@since("3.1.0")
18441844
def summary(self):
18451845
"""
1846-
Gets summary (e.g. accuracy/precision/recall, objective history, total iterations) of model
1846+
Gets summary (accuracy/precision/recall, objective history, total iterations) of model
18471847
trained on the training set. An exception is thrown if `trainingSummary is None`.
18481848
"""
18491849
if self.hasSummary:
@@ -2700,7 +2700,7 @@ def weights(self):
27002700
@since("3.1.0")
27012701
def summary(self):
27022702
"""
2703-
Gets summary (e.g. accuracy/precision/recall, objective history, total iterations) of model
2703+
Gets summary (accuracy/precision/recall, objective history, total iterations) of model
27042704
trained on the training set. An exception is thrown if `trainingSummary is None`.
27052705
"""
27062706
if self.hasSummary:
@@ -3500,7 +3500,7 @@ def factors(self):
35003500
@since("3.1.0")
35013501
def summary(self):
35023502
"""
3503-
Gets summary (e.g. accuracy/precision/recall, objective history, total iterations) of model
3503+
Gets summary (accuracy/precision/recall, objective history, total iterations) of model
35043504
trained on the training set. An exception is thrown if `trainingSummary is None`.
35053505
"""
35063506
if self.hasSummary:

python/pyspark/ml/clustering.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def gaussiansDF(self):
189189
@since("2.1.0")
190190
def summary(self):
191191
"""
192-
Gets summary (e.g. cluster assignments, cluster sizes) of the model trained on the
192+
Gets summary (cluster assignments, cluster sizes) of the model trained on the
193193
training set. An exception is thrown if no summary exists.
194194
"""
195195
if self.hasSummary:
@@ -560,7 +560,7 @@ def clusterCenters(self):
560560
@since("2.1.0")
561561
def summary(self):
562562
"""
563-
Gets summary (e.g. cluster assignments, cluster sizes) of the model trained on the
563+
Gets summary (cluster assignments, cluster sizes) of the model trained on the
564564
training set. An exception is thrown if no summary exists.
565565
"""
566566
if self.hasSummary:
@@ -828,7 +828,7 @@ def computeCost(self, dataset):
828828
@since("2.1.0")
829829
def summary(self):
830830
"""
831-
Gets summary (e.g. cluster assignments, cluster sizes) of the model trained on the
831+
Gets summary (cluster assignments, cluster sizes) of the model trained on the
832832
training set. An exception is thrown if no summary exists.
833833
"""
834834
if self.hasSummary:

python/pyspark/ml/regression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ def scale(self):
348348
@since("2.0.0")
349349
def summary(self):
350350
"""
351-
Gets summary (e.g. residuals, mse, r-squared ) of model on
351+
Gets summary (residuals, MSE, r-squared ) of model on
352352
training set. An exception is thrown if
353353
`trainingSummary is None`.
354354
"""
@@ -2270,7 +2270,7 @@ def intercept(self):
22702270
@since("2.0.0")
22712271
def summary(self):
22722272
"""
2273-
Gets summary (e.g. residuals, deviance, pValues) of model on
2273+
Gets summary (residuals, deviance, p-values) of model on
22742274
training set. An exception is thrown if
22752275
`trainingSummary is None`.
22762276
"""

python/pyspark/ml/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ class GeneralMLWriter(MLWriter):
152152

153153
def format(self, source):
154154
"""
155-
Specifies the format of ML export (e.g. "pmml", "internal", or the fully qualified class
155+
Specifies the format of ML export ("pmml", "internal", or the fully qualified class
156156
name for export).
157157
"""
158158
self.source = source
@@ -202,7 +202,7 @@ def __init__(self, instance):
202202

203203
def format(self, source):
204204
"""
205-
Specifies the format of ML export (e.g. "pmml", "internal", or the fully qualified class
205+
Specifies the format of ML export ("pmml", "internal", or the fully qualified class
206206
name for export).
207207
"""
208208
self._jwrite.format(source)

python/pyspark/pandas/datetimes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,7 @@ def strftime(self, date_format) -> "ps.Series":
576576
Parameters
577577
----------
578578
date_format : str
579-
Date format string (e.g. "%%Y-%%m-%%d").
579+
Date format string (example: "%%Y-%%m-%%d").
580580
581581
Returns
582582
-------

python/pyspark/pandas/frame.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2994,7 +2994,7 @@ def between_time(
29942994
axis: Union[int, str] = 0,
29952995
) -> "DataFrame":
29962996
"""
2997-
Select values between particular times of the day (e.g., 9:00-9:30 AM).
2997+
Select values between particular times of the day (example: 9:00-9:30 AM).
29982998
29992999
By setting ``start_time`` to be later than ``end_time``,
30003000
you can get the times that are *not* between the two times.
@@ -3088,7 +3088,7 @@ def at_time(
30883088
self, time: Union[datetime.time, str], asof: bool = False, axis: Union[int, str] = 0
30893089
) -> "DataFrame":
30903090
"""
3091-
Select values at particular time of day (e.g., 9:30AM).
3091+
Select values at particular time of day (example: 9:30AM).
30923092
30933093
Parameters
30943094
----------

python/pyspark/pandas/indexes/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,7 @@ def fillna(self, value: Scalar) -> "Index":
762762
Parameters
763763
----------
764764
value : scalar
765-
Scalar value to use to fill holes (e.g. 0). This value cannot be a list-likes.
765+
Scalar value to use to fill holes (example: 0). This value cannot be a list-likes.
766766
767767
Returns
768768
-------

python/pyspark/pandas/indexes/datetimes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ def strftime(self, date_format: str) -> Index:
614614
Parameters
615615
----------
616616
date_format : str
617-
Date format string (e.g. "%%Y-%%m-%%d").
617+
Date format string (example: "%%Y-%%m-%%d").
618618
619619
Returns
620620
-------
@@ -646,7 +646,7 @@ def indexer_between_time(
646646
) -> Index:
647647
"""
648648
Return index locations of values between particular times of day
649-
(e.g., 9:00-9:30AM).
649+
(example: 9:00-9:30AM).
650650
651651
Parameters
652652
----------
@@ -694,7 +694,7 @@ def pandas_between_time(pdf) -> ps.DataFrame[int]:
694694
def indexer_at_time(self, time: Union[datetime.time, str], asof: bool = False) -> Index:
695695
"""
696696
Return index locations of values at particular time of day
697-
(e.g. 9:30AM).
697+
(example: 9:30AM).
698698
699699
Parameters
700700
----------

python/pyspark/pandas/namespace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1229,7 +1229,7 @@ def read_html(
12291229
the encoding provided by the document).
12301230
12311231
decimal : str, default '.'
1232-
Character to recognize as decimal point (e.g. use ',' for European
1232+
Character to recognize as decimal point (example: use ',' for European
12331233
data).
12341234
12351235
converters : dict, default None

python/pyspark/pandas/series.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5834,7 +5834,7 @@ def between_time(
58345834
axis: Union[int, str] = 0,
58355835
) -> "Series":
58365836
"""
5837-
Select values between particular times of the day (e.g., 9:00-9:30 AM).
5837+
Select values between particular times of the day (example: 9:00-9:30 AM).
58385838
58395839
By setting ``start_time`` to be later than ``end_time``,
58405840
you can get the times that are *not* between the two times.
@@ -5893,7 +5893,7 @@ def at_time(
58935893
self, time: Union[datetime.time, str], asof: bool = False, axis: Union[int, str] = 0
58945894
) -> "Series":
58955895
"""
5896-
Select values at particular time of day (e.g., 9:30AM).
5896+
Select values at particular time of day (example: 9:30AM).
58975897
58985898
Parameters
58995899
----------

0 commit comments

Comments
 (0)