Skip to content

Commit

Permalink
fix style issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mgaido91 committed Jan 18, 2018
1 parent b1b0485 commit 5ed87ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Expand Up @@ -584,6 +584,7 @@ object KMeans {
case _ => false
}
}

private[spark] def validateDistanceMeasure(distanceMeasure: String): Boolean = {
distanceMeasure match {
case DistanceMeasure.EUCLIDEAN => true
Expand All @@ -598,8 +599,8 @@ object KMeans {
*
* @see [[org.apache.spark.mllib.clustering.KMeans#fastSquaredDistance]]
*/
private[clustering]
class VectorWithNorm(val vector: Vector, val norm: Double) extends Serializable {
private[clustering] class VectorWithNorm(val vector: Vector, val norm: Double)
extends Serializable {

def this(vector: Vector) = this(vector, Vectors.norm(vector, 2.0))

Expand All @@ -616,8 +617,8 @@ private[spark] abstract class DistanceMeasure extends Serializable {
* @return the index of the closest center to the given point, as well as the cost.
*/
def findClosest(
centers: TraversableOnce[VectorWithNorm],
point: VectorWithNorm): (Int, Double) = {
centers: TraversableOnce[VectorWithNorm],
point: VectorWithNorm): (Int, Double) = {
var bestDistance = Double.PositiveInfinity
var bestIndex = 0
var i = 0
Expand Down
Expand Up @@ -176,8 +176,7 @@ object KMeansModel extends Loader[KMeansModel] {

private val thisFormatVersion = "2.0"

private[clustering]
val thisClassName = "org.apache.spark.mllib.clustering.KMeansModel"
private[clustering] val thisClassName = "org.apache.spark.mllib.clustering.KMeansModel"

def save(sc: SparkContext, model: KMeansModel, path: String): Unit = {
val spark = SparkSession.builder().sparkContext(sc).getOrCreate()
Expand Down

0 comments on commit 5ed87ea

Please sign in to comment.