Github user keypointt commented on a diff in the pull request:

    https://github.com/apache/spark/pull/12432#discussion_r59957731
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/clustering/KMeans.scala 
---
    @@ -264,6 +264,9 @@ class KMeans @Since("1.5.0") (
       override def fit(dataset: Dataset[_]): KMeansModel = {
         val rdd = dataset.select(col($(featuresCol))).rdd.map { case 
Row(point: Vector) => point }
     
    +    val instr = Instrumentation.create(this, rdd)
    +    instr.logParams(featuresCol, predictionCol, k, initMode, initSteps, 
maxIter, seed, tol)
    +
         val algo = new MLlibKMeans()
    --- End diff --
    
    Thanks Timothy. I'm a starter on Spark sorry for being naive. 
    I just want to confirm with you that I understand correctly.
    
    1. for creating a new method `algo.run(rdd, instr)`, I just find I also 
need to create another method `runAlgorithm(zippedData, instr)` to take `instr` 
as a parameter 
https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeans.scala#L241
 , since inside 'runAlgorithm' is the dimension we want 
https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/mllib/clustering/KMeans.scala#L295
    
    1. class 'Instrumentation' is private and in ml package, so it cannot be 
accessed from mllib package. So I have to change it to be public by removing 
`private[ml] `? 
https://github.com/apache/spark/blob/master/mllib/src/main/scala/org/apache/spark/ml/util/Instrumentation.scala#L42


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to