Skip to content

Commit 8bda047

Browse files
committed
Minor style fixes
1 parent 0f1053c commit 8bda047

File tree

2 files changed

+18
-10
lines changed

2 files changed

+18
-10
lines changed

mllib/src/main/scala/org/apache/spark/mllib/api/python/PythonMLLibAPI.scala

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,7 @@ private[python] class PythonMLLibAPI extends Serializable {
961961
def estimateKernelDensity(
962962
sample: JavaRDD[Double],
963963
bandwidth: Double, points: java.util.ArrayList[Double]): Array[Double] = {
964-
return new KernelDensity().setSample(sample).setBandwidth(bandwidth).estimate(
964+
new KernelDensity().setSample(sample).setBandwidth(bandwidth).estimate(
965965
points.asScala.toArray)
966966
}
967967

@@ -985,20 +985,28 @@ private[python] class PythonMLLibAPI extends Serializable {
985985
*/
986986
def generateLinearInputWrapper(
987987
intercept: Double,
988-
weights: JArrayList[Double], xMean: JArrayList[Double],
989-
xVariance: JArrayList[Double], nPoints: Int, seed: Int, eps: Double): Array[LabeledPoint] = {
990-
return LinearDataGenerator.generateLinearInput(
991-
intercept, weights.asScala.toArray, xMean.asScala.toArray,
992-
xVariance.asScala.toArray, nPoints, seed, eps).toArray
988+
weights: JList[Double],
989+
xMean: JList[Double],
990+
xVariance: JList[Double],
991+
nPoints: Int,
992+
seed: Int,
993+
eps: Double): Array[LabeledPoint] = {
994+
LinearDataGenerator.generateLinearInput(
995+
intercept, weights.asScala.toArray, xMean.asScala.toArray,
996+
xVariance.asScala.toArray, nPoints, seed, eps).toArray
993997
}
994998

995999
/**
9961000
* Wrapper around the generateLinearRDD method of LinearDataGenerator.
9971001
*/
9981002
def generateLinearRDDWrapper(
999-
sc: JavaSparkContext, nexamples: Int, nfeatures: Int,
1000-
eps: Double, nparts: Int, intercept: Double): JavaRDD[LabeledPoint] = {
1001-
return LinearDataGenerator.generateLinearRDD(
1003+
sc: JavaSparkContext,
1004+
nexamples: Int,
1005+
nfeatures: Int,
1006+
eps: Double,
1007+
nparts: Int,
1008+
intercept: Double): JavaRDD[LabeledPoint] = {
1009+
LinearDataGenerator.generateLinearRDD(
10021010
sc, nexamples, nfeatures, eps, nparts, intercept)
10031011
}
10041012
}

python/pyspark/mllib/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ def generateLinearInput(intercept, weights, xMean, xVariance,
265265
nPoints, seed, eps):
266266
"""
267267
:param: intercept bias factor, the term c in X'w + c
268-
:param: weights feature vector the term w in X'w + c
268+
:param: weights feature vector, the term w in X'w + c
269269
:param: xMean Point around which the data X is centered.
270270
:param: xVariance Variance of the given data
271271
:param: nPoints Number of points to be generated

0 commit comments

Comments
 (0)