diff options
author | Yanbo Liang <ybliang8@gmail.com> | 2015-12-03 11:37:34 -0800 |
---|---|---|
committer | Xiangrui Meng <meng@databricks.com> | 2015-12-03 11:37:34 -0800 |
commit | d576e76bbaa818480d31d2b8fbbe4b15718307d9 (patch) | |
tree | 5517b7f712c69f8c11872815719e79874f715eee | |
parent | 688e521c2833a00069272a6749153d721a0996f6 (diff) | |
download | spark-d576e76bbaa818480d31d2b8fbbe4b15718307d9.tar.gz spark-d576e76bbaa818480d31d2b8fbbe4b15718307d9.tar.bz2 spark-d576e76bbaa818480d31d2b8fbbe4b15718307d9.zip |
[MINOR][ML] Use coefficients replace weights
Use ```coefficients``` replace ```weights```, I wish they are the last two.
mengxr
Author: Yanbo Liang <ybliang8@gmail.com>
Closes #10065 from yanboliang/coefficients.
-rw-r--r-- | python/pyspark/ml/classification.py | 2 | ||||
-rw-r--r-- | python/pyspark/ml/regression.py | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/python/pyspark/ml/classification.py b/python/pyspark/ml/classification.py index 4a2982e204..5599b8f3ec 100644 --- a/python/pyspark/ml/classification.py +++ b/python/pyspark/ml/classification.py @@ -49,7 +49,7 @@ class LogisticRegression(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPredicti ... Row(label=0.0, weight=2.0, features=Vectors.sparse(1, [], []))]).toDF() >>> lr = LogisticRegression(maxIter=5, regParam=0.01, weightCol="weight") >>> model = lr.fit(df) - >>> model.weights + >>> model.coefficients DenseVector([5.5...]) >>> model.intercept -2.68... diff --git a/python/pyspark/ml/regression.py b/python/pyspark/ml/regression.py index 944e648ec8..a0bb8ceed8 100644 --- a/python/pyspark/ml/regression.py +++ b/python/pyspark/ml/regression.py @@ -40,7 +40,7 @@ class LinearRegression(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPrediction Linear regression. The learning objective is to minimize the squared error, with regularization. - The specific squared error loss function used is: L = 1/2n ||A weights - y||^2^ + The specific squared error loss function used is: L = 1/2n ||A coefficients - y||^2^ This support multiple types of regularization: - none (a.k.a. ordinary least squares) |