diff options
Diffstat (limited to 'examples/src/main/python/mllib/svm_with_sgd_example.py')
-rw-r--r-- | examples/src/main/python/mllib/svm_with_sgd_example.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/src/main/python/mllib/svm_with_sgd_example.py b/examples/src/main/python/mllib/svm_with_sgd_example.py index 309ab09cc3..24b8f431e0 100644 --- a/examples/src/main/python/mllib/svm_with_sgd_example.py +++ b/examples/src/main/python/mllib/svm_with_sgd_example.py @@ -38,7 +38,7 @@ if __name__ == "__main__": # Evaluating the model on training data labelsAndPreds = parsedData.map(lambda p: (p.label, model.predict(p.features))) - trainErr = labelsAndPreds.filter(lambda (v, p): v != p).count() / float(parsedData.count()) + trainErr = labelsAndPreds.filter(lambda lp: lp[0] != lp[1]).count() / float(parsedData.count()) print("Training Error = " + str(trainErr)) # Save and load model |