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

    https://github.com/apache/spark/pull/17117#discussion_r104084997
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/clustering/KMeans.scala 
---
    @@ -253,7 +255,18 @@ object KMeansModel extends MLReadable[KMeansModel] {
     @Since("1.5.0")
     class KMeans @Since("1.5.0") (
         @Since("1.5.0") override val uid: String)
    -  extends Estimator[KMeansModel] with KMeansParams with 
DefaultParamsWritable {
    +  extends Estimator[KMeansModel]
    +    with KMeansParams with HasInitialModel[KMeansModel] with MLWritable {
    +
    +  /**
    +   * A KMeansModel to use for warm start.
    +   * Note the cluster count of initial model must be equal with [[k]],
    +   * otherwise, throws IllegalArgumentException.
    +   * @group param
    +   */
    +  @Since("2.2.0")
    +  final val initialModel: Param[KMeansModel] =
    --- End diff --
    
    I prefer doing this in the same way that ALS does it. By having separate 
param traits `KMeansParams extends KMeansModelParams with HasInitialModel`. 
It's more explicit since now our `KMeans` class would have extra params on top 
of `KMeansParams`. 


---
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