Skip to content

Commit

Permalink
Minor style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MechCoder committed Jun 19, 2015
1 parent 0f1053c commit 8bda047
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -961,7 +961,7 @@ private[python] class PythonMLLibAPI extends Serializable {
def estimateKernelDensity(
sample: JavaRDD[Double],
bandwidth: Double, points: java.util.ArrayList[Double]): Array[Double] = {
return new KernelDensity().setSample(sample).setBandwidth(bandwidth).estimate(
new KernelDensity().setSample(sample).setBandwidth(bandwidth).estimate(
points.asScala.toArray)
}

Expand All @@ -985,20 +985,28 @@ private[python] class PythonMLLibAPI extends Serializable {
*/
def generateLinearInputWrapper(
intercept: Double,
weights: JArrayList[Double], xMean: JArrayList[Double],
xVariance: JArrayList[Double], nPoints: Int, seed: Int, eps: Double): Array[LabeledPoint] = {
return LinearDataGenerator.generateLinearInput(
intercept, weights.asScala.toArray, xMean.asScala.toArray,
xVariance.asScala.toArray, nPoints, seed, eps).toArray
weights: JList[Double],
xMean: JList[Double],
xVariance: JList[Double],
nPoints: Int,
seed: Int,
eps: Double): Array[LabeledPoint] = {
LinearDataGenerator.generateLinearInput(
intercept, weights.asScala.toArray, xMean.asScala.toArray,
xVariance.asScala.toArray, nPoints, seed, eps).toArray
}

/**
* Wrapper around the generateLinearRDD method of LinearDataGenerator.
*/
def generateLinearRDDWrapper(
sc: JavaSparkContext, nexamples: Int, nfeatures: Int,
eps: Double, nparts: Int, intercept: Double): JavaRDD[LabeledPoint] = {
return LinearDataGenerator.generateLinearRDD(
sc: JavaSparkContext,
nexamples: Int,
nfeatures: Int,
eps: Double,
nparts: Int,
intercept: Double): JavaRDD[LabeledPoint] = {
LinearDataGenerator.generateLinearRDD(
sc, nexamples, nfeatures, eps, nparts, intercept)
}
}
Expand Down
2 changes: 1 addition & 1 deletion python/pyspark/mllib/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def generateLinearInput(intercept, weights, xMean, xVariance,
nPoints, seed, eps):
"""
:param: intercept bias factor, the term c in X'w + c
:param: weights feature vector the term w in X'w + c
:param: weights feature vector, the term w in X'w + c
:param: xMean Point around which the data X is centered.
:param: xVariance Variance of the given data
:param: nPoints Number of points to be generated
Expand Down

0 comments on commit 8bda047

Please sign in to comment.