aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/mllib/util.py
diff options
context:
space:
mode:
authorReynold Xin <rxin@apache.org>2014-05-25 17:15:01 -0700
committerReynold Xin <rxin@apache.org>2014-05-25 17:15:01 -0700
commitd33d3c61ae9e4551aed0217e525a109e678298f2 (patch)
tree109ffeeaf31ae267bbe791051fd39f490af04aa4 /python/pyspark/mllib/util.py
parent14f0358b2a0a9b92526bdad6d501ab753459eaa0 (diff)
downloadspark-d33d3c61ae9e4551aed0217e525a109e678298f2.tar.gz
spark-d33d3c61ae9e4551aed0217e525a109e678298f2.tar.bz2
spark-d33d3c61ae9e4551aed0217e525a109e678298f2.zip
Fix PEP8 violations in Python mllib.
Author: Reynold Xin <rxin@apache.org> Closes #871 from rxin/mllib-pep8 and squashes the following commits: 848416f [Reynold Xin] Fixed a typo in the previous cleanup (c -> sc). a8db4cd [Reynold Xin] Fix PEP8 violations in Python mllib.
Diffstat (limited to 'python/pyspark/mllib/util.py')
-rw-r--r--python/pyspark/mllib/util.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/python/pyspark/mllib/util.py b/python/pyspark/mllib/util.py
index 50d0cdd087..0e5f4520b9 100644
--- a/python/pyspark/mllib/util.py
+++ b/python/pyspark/mllib/util.py
@@ -21,6 +21,7 @@ from pyspark.mllib.linalg import Vectors, SparseVector
from pyspark.mllib.regression import LabeledPoint
from pyspark.mllib._common import _convert_vector
+
class MLUtils:
"""
Helper methods to load, save and pre-process data used in MLlib.
@@ -44,7 +45,6 @@ class MLUtils:
values[i] = float(value)
return label, indices, values
-
@staticmethod
def _convert_labeled_point_to_libsvm(p):
"""Converts a LabeledPoint to a string in LIBSVM format."""
@@ -62,7 +62,6 @@ class MLUtils:
" but got " % type(v))
return " ".join(items)
-
@staticmethod
def loadLibSVMFile(sc, path, multiclass=False, numFeatures=-1, minPartitions=None):
"""
@@ -135,7 +134,6 @@ class MLUtils:
numFeatures = parsed.map(lambda x: 0 if x[1].size == 0 else x[1][-1]).reduce(max) + 1
return parsed.map(lambda x: LabeledPoint(x[0], Vectors.sparse(numFeatures, x[1], x[2])))
-
@staticmethod
def saveAsLibSVMFile(data, dir):
"""