aboutsummaryrefslogtreecommitdiff
path: root/examples/src/main/python/mllib/linear_regression_with_sgd_example.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/src/main/python/mllib/linear_regression_with_sgd_example.py')
-rw-r--r--examples/src/main/python/mllib/linear_regression_with_sgd_example.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/src/main/python/mllib/linear_regression_with_sgd_example.py b/examples/src/main/python/mllib/linear_regression_with_sgd_example.py
index 6fbaeff0cd..6744463d40 100644
--- a/examples/src/main/python/mllib/linear_regression_with_sgd_example.py
+++ b/examples/src/main/python/mllib/linear_regression_with_sgd_example.py
@@ -44,7 +44,7 @@ if __name__ == "__main__":
# Evaluate the model on training data
valuesAndPreds = parsedData.map(lambda p: (p.label, model.predict(p.features)))
MSE = valuesAndPreds \
- .map(lambda (v, p): (v - p)**2) \
+ .map(lambda vp: (vp[0] - vp[1])**2) \
.reduce(lambda x, y: x + y) / valuesAndPreds.count()
print("Mean Squared Error = " + str(MSE))