Skip to content

Commit e0577f5

Browse files
yanboliangmengxr
authored andcommitted
[MINOR][ML] Use coefficients replace weights
Use ```coefficients``` replace ```weights```, I wish they are the last two. mengxr Author: Yanbo Liang <[email protected]> Closes #10065 from yanboliang/coefficients. (cherry picked from commit d576e76) Signed-off-by: Xiangrui Meng <[email protected]>
1 parent bf8b95f commit e0577f5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

python/pyspark/ml/classification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class LogisticRegression(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPredicti
4949
... Row(label=0.0, weight=2.0, features=Vectors.sparse(1, [], []))]).toDF()
5050
>>> lr = LogisticRegression(maxIter=5, regParam=0.01, weightCol="weight")
5151
>>> model = lr.fit(df)
52-
>>> model.weights
52+
>>> model.coefficients
5353
DenseVector([5.5...])
5454
>>> model.intercept
5555
-2.68...

python/pyspark/ml/regression.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class LinearRegression(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPrediction
4040
Linear regression.
4141
4242
The learning objective is to minimize the squared error, with regularization.
43-
The specific squared error loss function used is: L = 1/2n ||A weights - y||^2^
43+
The specific squared error loss function used is: L = 1/2n ||A coefficients - y||^2^
4444
4545
This support multiple types of regularization:
4646
- none (a.k.a. ordinary least squares)

0 commit comments

Comments
 (0)