Skip to content

Commit

Permalink
Rebase mater branch and add copy methods
Browse files Browse the repository at this point in the history
  • Loading branch information
yu-iskw committed Jul 1, 2015
1 parent 85d92b1 commit f80319a
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,12 @@ class KMeansModel private[ml] (
val paramMap: ParamMap,
val parentModel: mllib.clustering.KMeansModel
) extends Model[KMeansModel] with KMeansParams {

override def copy(extra: ParamMap): KMeansModel = {
val copied = new KMeansModel(uid, paramMap, parentModel)
copyValues(copied, extra)
}

/**
* Transforms the input dataset.
*/
Expand Down Expand Up @@ -145,6 +151,8 @@ class KMeans(override val uid: String) extends Estimator[KMeansModel] with KMean
setEpsilon(1e-4)
setSeed(Utils.random.nextLong())

override def copy(extra: ParamMap): Estimator[KMeansModel] = defaultCopy(extra)

def this() = this(Identifiable.randomUID("kmeans"))

/** @group setParam */
Expand Down

0 comments on commit f80319a

Please sign in to comment.