aboutsummaryrefslogtreecommitdiff
path: root/examples/src/main/python/mllib/gradient_boosting_regression_example.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/src/main/python/mllib/gradient_boosting_regression_example.py')
-rw-r--r--examples/src/main/python/mllib/gradient_boosting_regression_example.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/src/main/python/mllib/gradient_boosting_regression_example.py b/examples/src/main/python/mllib/gradient_boosting_regression_example.py
index 758e224a9e..877f8ab461 100644
--- a/examples/src/main/python/mllib/gradient_boosting_regression_example.py
+++ b/examples/src/main/python/mllib/gradient_boosting_regression_example.py
@@ -43,7 +43,7 @@ if __name__ == "__main__":
# Evaluate model on test instances and compute test error
predictions = model.predict(testData.map(lambda x: x.features))
labelsAndPredictions = testData.map(lambda lp: lp.label).zip(predictions)
- testMSE = labelsAndPredictions.map(lambda (v, p): (v - p) * (v - p)).sum() /\
+ testMSE = labelsAndPredictions.map(lambda lp: (lp[0] - lp[1]) * (lp[0] - lp[1])).sum() /\
float(testData.count())
print('Test Mean Squared Error = ' + str(testMSE))
print('Learned regression GBT model:')