Github user mengxr commented on a diff in the pull request:

    https://github.com/apache/spark/pull/5173#discussion_r28483597
  
    --- Diff: examples/src/main/python/mllib/gradient_boosted_trees.py ---
    @@ -49,8 +50,8 @@ def testRegression(trainingData, testData):
         # 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() \
    -        / float(testData.count())
    +    testMSE = labelsAndPredictions.map(lambda v_p1: (v_p1[0] - v_p1[1]) * 
(v_p1[0] - v_p1[1]))\
    --- End diff --
    
    Why using `v_p1` instead of `vp` or `v_p`?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to