spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sethah <...@git.apache.org>
Subject [GitHub] spark pull request #17117: [SPARK-10780][ML] Support initial model for KMean...
Date Fri, 03 Mar 2017 06:25:49 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

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


Mime
View raw message