aboutsummaryrefslogtreecommitdiff
path: root/examples/src/main/python/logistic_regression.py
diff options
context:
space:
mode:
authorReynold Xin <rxin@apache.org>2014-05-25 14:48:27 -0700
committerReynold Xin <rxin@apache.org>2014-05-25 14:48:27 -0700
commitd79c2b28e17ec0b15198aaedd2e1f403d81f717e (patch)
tree1917d4285692d387de250f8ee8192f794bb2966c /examples/src/main/python/logistic_regression.py
parent55fddf9cc0fe420d5396b0e730c8413b2f23d636 (diff)
downloadspark-d79c2b28e17ec0b15198aaedd2e1f403d81f717e.tar.gz
spark-d79c2b28e17ec0b15198aaedd2e1f403d81f717e.tar.bz2
spark-d79c2b28e17ec0b15198aaedd2e1f403d81f717e.zip
Fix PEP8 violations in examples/src/main/python.
Author: Reynold Xin <rxin@apache.org> Closes #870 from rxin/examples-python-pep8 and squashes the following commits: 2829e84 [Reynold Xin] Fix PEP8 violations in examples/src/main/python.
Diffstat (limited to 'examples/src/main/python/logistic_regression.py')
-rwxr-xr-xexamples/src/main/python/logistic_regression.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/src/main/python/logistic_regression.py b/examples/src/main/python/logistic_regression.py
index 0f22d0b323..6c33deabfd 100755
--- a/examples/src/main/python/logistic_regression.py
+++ b/examples/src/main/python/logistic_regression.py
@@ -60,8 +60,8 @@ if __name__ == "__main__":
# Compute logistic regression gradient for a matrix of data points
def gradient(matrix, w):
- Y = matrix[:,0] # point labels (first column of input file)
- X = matrix[:,1:] # point coordinates
+ Y = matrix[:, 0] # point labels (first column of input file)
+ X = matrix[:, 1:] # point coordinates
# For each point (x, y), compute gradient function, then sum these up
return ((1.0 / (1.0 + np.exp(-Y * X.dot(w))) - 1.0) * Y * X.T).sum(1)