@@ -345,9 +345,7 @@ private[python] class PythonMLLibAPI extends Serializable {
345345 val model = new GaussianMixtureModel (weight, gaussians)
346346 model.predictSoft(data)
347347 }
348-
349-
350-
348+
351349 /**
352350 * Java stub for Python mllib ALS.train(). This stub returns a handle
353351 * to the Java object instead of the content of the Java object. Extra care
@@ -408,10 +406,11 @@ private[python] class PythonMLLibAPI extends Serializable {
408406 }
409407
410408 /**
411- * A Wrapper of FPGrowthModel to provide helpfer method for Python
409+ * A Wrapper of FPGrowthModel to provide helper method for Python
412410 */
413411 private [python] class FPGrowthModelWrapper (model : FPGrowthModel [Any ])
414412 extends FPGrowthModel (model.freqItemsets) {
413+
415414 def getFreqItemsets : RDD [Array [Any ]] = {
416415 SerDe .fromTuple2RDD(model.freqItemsets.map(x => (x.javaItems, x.freq)))
417416 }
@@ -423,12 +422,13 @@ private[python] class PythonMLLibAPI extends Serializable {
423422 * needs to be taken in the Python code to ensure it gets freed on exit; see
424423 * the Py4J documentation.
425424 */
426- def trainFPGrowthModel (data : JavaRDD [java.lang.Iterable [Any ]],
425+ def trainFPGrowthModel (
426+ data : JavaRDD [java.lang.Iterable [Any ]],
427427 minSupport : Double ,
428- numPartition : Int ): FPGrowthModel [Any ] = {
428+ numPartitions : Int ): FPGrowthModel [Any ] = {
429429 val fpm = new FPGrowth ()
430430 .setMinSupport(minSupport)
431- .setNumPartitions(numPartition )
431+ .setNumPartitions(numPartitions )
432432
433433 val model = fpm.run(data.rdd.map(_.asScala.toArray))
434434 new FPGrowthModelWrapper (model)
0 commit comments