Skip to content

Commit e44495f

Browse files
committed
fix docstring signature
1 parent 7fb715d commit e44495f

File tree

5 files changed

+52
-55
lines changed

5 files changed

+52
-55
lines changed

python/docs/pyspark.ml.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
pyspark.ml package
2-
=====================
2+
==================
33

44
ML Pipeline APIs
5-
--------------
5+
----------------
66

77
.. automodule:: pyspark.ml
88
:members:
99
:undoc-members:
1010
:inherited-members:
1111

1212
pyspark.ml.param module
13-
-------------------------
13+
-----------------------
1414

1515
.. automodule:: pyspark.ml.param
1616
:members:
@@ -34,31 +34,31 @@ pyspark.ml.classification module
3434
:inherited-members:
3535

3636
pyspark.ml.recommendation module
37-
-------------------------
37+
--------------------------------
3838

3939
.. automodule:: pyspark.ml.recommendation
4040
:members:
4141
:undoc-members:
4242
:inherited-members:
4343

4444
pyspark.ml.regression module
45-
-------------------------
45+
----------------------------
4646

4747
.. automodule:: pyspark.ml.regression
4848
:members:
4949
:undoc-members:
5050
:inherited-members:
5151

5252
pyspark.ml.tuning module
53-
--------------------------------
53+
------------------------
5454

5555
.. automodule:: pyspark.ml.tuning
5656
:members:
5757
:undoc-members:
5858
:inherited-members:
5959

6060
pyspark.ml.evaluation module
61-
--------------------------------
61+
----------------------------
6262

6363
.. automodule:: pyspark.ml.evaluation
6464
:members:

python/pyspark/ml/classification.py

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ def __init__(self, featuresCol="features", labelCol="label", predictionCol="pred
6767
threshold=0.5, probabilityCol="probability"):
6868
"""
6969
__init__(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
70-
maxIter=100, regParam=0.1, elasticNetParam=0.0, tol=1e-6, fitIntercept=True,
70+
maxIter=100, regParam=0.1, elasticNetParam=0.0, tol=1e-6, fitIntercept=True, \
7171
threshold=0.5, probabilityCol="probability")
7272
"""
7373
super(LogisticRegression, self).__init__()
@@ -92,8 +92,8 @@ def setParams(self, featuresCol="features", labelCol="label", predictionCol="pre
9292
maxIter=100, regParam=0.1, elasticNetParam=0.0, tol=1e-6, fitIntercept=True,
9393
threshold=0.5, probabilityCol="probability"):
9494
"""
95-
setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction",
96-
maxIter=100, regParam=0.1, elasticNetParam=0.0, tol=1e-6, fitIntercept=True,
95+
setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
96+
maxIter=100, regParam=0.1, elasticNetParam=0.0, tol=1e-6, fitIntercept=True, \
9797
threshold=0.5, probabilityCol="probability")
9898
Sets params for logistic regression.
9999
"""
@@ -202,7 +202,7 @@ def __init__(self, featuresCol="features", labelCol="label", predictionCol="pred
202202
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, impurity="gini"):
203203
"""
204204
__init__(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
205-
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
205+
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \
206206
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, impurity="gini")
207207
"""
208208
super(DecisionTreeClassifier, self).__init__()
@@ -224,9 +224,8 @@ def setParams(self, featuresCol="features", labelCol="label", predictionCol="pre
224224
impurity="gini"):
225225
"""
226226
setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
227-
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
228-
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10,
229-
impurity="gini")
227+
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \
228+
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, impurity="gini")
230229
Sets params for the DecisionTreeClassifier.
231230
"""
232231
kwargs = self.setParams._input_kwargs
@@ -302,9 +301,9 @@ def __init__(self, featuresCol="features", labelCol="label", predictionCol="pred
302301
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, impurity="gini",
303302
numTrees=20, featureSubsetStrategy="auto", seed=42):
304303
"""
305-
__init__(self, featuresCol="features", labelCol="label", predictionCol="prediction",
306-
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
307-
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, impurity="gini",
304+
__init__(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
305+
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \
306+
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, impurity="gini", \
308307
numTrees=20, featureSubsetStrategy="auto", seed=42)
309308
"""
310309
super(RandomForestClassifier, self).__init__()
@@ -337,9 +336,9 @@ def setParams(self, featuresCol="features", labelCol="label", predictionCol="pre
337336
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, seed=42,
338337
impurity="gini", numTrees=20, featureSubsetStrategy="auto"):
339338
"""
340-
setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction",
341-
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
342-
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, seed=42,
339+
setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
340+
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \
341+
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, seed=42, \
343342
impurity="gini", numTrees=20, featureSubsetStrategy="auto")
344343
Sets params for linear classification.
345344
"""
@@ -453,10 +452,10 @@ def __init__(self, featuresCol="features", labelCol="label", predictionCol="pred
453452
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, lossType="logistic",
454453
maxIter=20, stepSize=0.1):
455454
"""
456-
__init__(self, featuresCol="features", labelCol="label", predictionCol="prediction",
457-
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
458-
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, lossType="logistic",
459-
maxIter=20, stepSize=0.1)
455+
__init__(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
456+
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \
457+
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, \
458+
lossType="logistic", maxIter=20, stepSize=0.1)
460459
"""
461460
super(GBTClassifier, self).__init__()
462461
#: param for Loss function which GBT tries to minimize (case-insensitive).
@@ -484,9 +483,9 @@ def setParams(self, featuresCol="features", labelCol="label", predictionCol="pre
484483
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10,
485484
lossType="logistic", maxIter=20, stepSize=0.1):
486485
"""
487-
setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction",
488-
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
489-
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10,
486+
setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
487+
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \
488+
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, \
490489
lossType="logistic", maxIter=20, stepSize=0.1)
491490
Sets params for Gradient Boosted Tree Classification.
492491
"""

python/pyspark/ml/feature.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ class RegexTokenizer(JavaTransformer, HasInputCol, HasOutputCol):
481481
def __init__(self, minTokenLength=1, gaps=False, pattern="\\p{L}+|[^\\p{L}\\s]+",
482482
inputCol=None, outputCol=None):
483483
"""
484-
__init__(self, minTokenLength=1, gaps=False, pattern="\\p{L}+|[^\\p{L}\\s]+",
484+
__init__(self, minTokenLength=1, gaps=False, pattern="\\p{L}+|[^\\p{L}\\s]+", \
485485
inputCol=None, outputCol=None)
486486
"""
487487
super(RegexTokenizer, self).__init__()
@@ -496,7 +496,7 @@ def __init__(self, minTokenLength=1, gaps=False, pattern="\\p{L}+|[^\\p{L}\\s]+"
496496
def setParams(self, minTokenLength=1, gaps=False, pattern="\\p{L}+|[^\\p{L}\\s]+",
497497
inputCol=None, outputCol=None):
498498
"""
499-
setParams(self, minTokenLength=1, gaps=False, pattern="\\p{L}+|[^\\p{L}\\s]+",
499+
setParams(self, minTokenLength=1, gaps=False, pattern="\\p{L}+|[^\\p{L}\\s]+", \
500500
inputCol="input", outputCol="output")
501501
Sets params for this RegexTokenizer.
502502
"""
@@ -869,7 +869,7 @@ class Word2Vec(JavaEstimator, HasStepSize, HasMaxIter, HasSeed, HasInputCol, Has
869869
def __init__(self, vectorSize=100, minCount=5, numPartitions=1, stepSize=0.025, maxIter=1,
870870
seed=42, inputCol=None, outputCol=None):
871871
"""
872-
__init__(self, vectorSize=100, minCount=5, numPartitions=1, stepSize=0.025, maxIter=1,
872+
__init__(self, vectorSize=100, minCount=5, numPartitions=1, stepSize=0.025, maxIter=1, \
873873
seed=42, inputCol=None, outputCol=None)
874874
"""
875875
super(Word2Vec, self).__init__()
@@ -889,7 +889,7 @@ def __init__(self, vectorSize=100, minCount=5, numPartitions=1, stepSize=0.025,
889889
def setParams(self, vectorSize=100, minCount=5, numPartitions=1, stepSize=0.025, maxIter=1,
890890
seed=42, inputCol=None, outputCol=None):
891891
"""
892-
setParams(self, minCount=5, numPartitions=1, stepSize=0.025, maxIter=1, seed=42,
892+
setParams(self, minCount=5, numPartitions=1, stepSize=0.025, maxIter=1, seed=42, \
893893
inputCol=None, outputCol=None)
894894
Sets params for this Word2Vec.
895895
"""

python/pyspark/ml/recommendation.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ def __init__(self, rank=10, maxIter=10, regParam=0.1, numUserBlocks=10, numItemB
9292
implicitPrefs=False, alpha=1.0, userCol="user", itemCol="item", seed=0,
9393
ratingCol="rating", nonnegative=False, checkpointInterval=10):
9494
"""
95-
__init__(self, rank=10, maxIter=10, regParam=0.1, numUserBlocks=10, numItemBlocks=10,
96-
implicitPrefs=false, alpha=1.0, userCol="user", itemCol="item", seed=0,
95+
__init__(self, rank=10, maxIter=10, regParam=0.1, numUserBlocks=10, numItemBlocks=10, \
96+
implicitPrefs=false, alpha=1.0, userCol="user", itemCol="item", seed=0, \
9797
ratingCol="rating", nonnegative=false, checkpointInterval=10)
9898
"""
9999
super(ALS, self).__init__()
@@ -118,8 +118,8 @@ def setParams(self, rank=10, maxIter=10, regParam=0.1, numUserBlocks=10, numItem
118118
implicitPrefs=False, alpha=1.0, userCol="user", itemCol="item", seed=0,
119119
ratingCol="rating", nonnegative=False, checkpointInterval=10):
120120
"""
121-
setParams(self, rank=10, maxIter=10, regParam=0.1, numUserBlocks=10, numItemBlocks=10,
122-
implicitPrefs=False, alpha=1.0, userCol="user", itemCol="item", seed=0,
121+
setParams(self, rank=10, maxIter=10, regParam=0.1, numUserBlocks=10, numItemBlocks=10, \
122+
implicitPrefs=False, alpha=1.0, userCol="user", itemCol="item", seed=0, \
123123
ratingCol="rating", nonnegative=False, checkpointInterval=10)
124124
Sets params for ALS.
125125
"""

python/pyspark/ml/regression.py

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ class LinearRegression(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPrediction
3333
Linear regression.
3434
3535
The learning objective is to minimize the squared error, with regularization.
36-
The specific squared error loss function used is:
37-
L = 1/2n ||A weights - y||^2^
36+
The specific squared error loss function used is: L = 1/2n ||A weights - y||^2^
3837
3938
This support multiple types of regularization:
4039
- none (a.k.a. ordinary least squares)
@@ -173,7 +172,7 @@ def __init__(self, featuresCol="features", labelCol="label", predictionCol="pred
173172
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, impurity="variance"):
174173
"""
175174
__init__(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
176-
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
175+
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \
177176
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, impurity="variance")
178177
"""
179178
super(DecisionTreeRegressor, self).__init__()
@@ -195,9 +194,8 @@ def setParams(self, featuresCol="features", labelCol="label", predictionCol="pre
195194
impurity="variance"):
196195
"""
197196
setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
198-
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
199-
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10,
200-
impurity="variance")
197+
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \
198+
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, impurity="variance")
201199
Sets params for the DecisionTreeRegressor.
202200
"""
203201
kwargs = self.setParams._input_kwargs
@@ -268,10 +266,10 @@ def __init__(self, featuresCol="features", labelCol="label", predictionCol="pred
268266
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, impurity="variance",
269267
numTrees=20, featureSubsetStrategy="auto", seed=42):
270268
"""
271-
__init__(self, featuresCol="features", labelCol="label", predictionCol="prediction",
272-
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
273-
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, impurity="variance",
274-
numTrees=20, featureSubsetStrategy="auto", seed=42)
269+
__init__(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
270+
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \
271+
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, \
272+
impurity="variance", numTrees=20, featureSubsetStrategy="auto", seed=42)
275273
"""
276274
super(RandomForestRegressor, self).__init__()
277275
#: param for Criterion used for information gain calculation (case-insensitive).
@@ -303,9 +301,9 @@ def setParams(self, featuresCol="features", labelCol="label", predictionCol="pre
303301
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, seed=42,
304302
impurity="variance", numTrees=20, featureSubsetStrategy="auto"):
305303
"""
306-
setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction",
307-
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
308-
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, seed=42,
304+
setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
305+
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \
306+
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, seed=42, \
309307
impurity="variance", numTrees=20, featureSubsetStrategy="auto")
310308
Sets params for linear regression.
311309
"""
@@ -414,10 +412,10 @@ def __init__(self, featuresCol="features", labelCol="label", predictionCol="pred
414412
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, lossType="squared",
415413
maxIter=20, stepSize=0.1):
416414
"""
417-
__init__(self, featuresCol="features", labelCol="label", predictionCol="prediction",
418-
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
419-
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, lossType="squared",
420-
maxIter=20, stepSize=0.1)
415+
__init__(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
416+
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \
417+
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, \
418+
lossType="squared", maxIter=20, stepSize=0.1)
421419
"""
422420
super(GBTRegressor, self).__init__()
423421
#: param for Loss function which GBT tries to minimize (case-insensitive).
@@ -445,9 +443,9 @@ def setParams(self, featuresCol="features", labelCol="label", predictionCol="pre
445443
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10,
446444
lossType="squared", maxIter=20, stepSize=0.1):
447445
"""
448-
setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction",
449-
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
450-
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10,
446+
setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
447+
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \
448+
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, \
451449
lossType="squared", maxIter=20, stepSize=0.1)
452450
Sets params for Gradient Boosted Tree Regression.
453451
"""

0 commit comments

Comments
 (0)