srowen commented on a change in pull request #28595:
URL: https://github.com/apache/spark/pull/28595#discussion_r429638501
##########
File path:
mllib/src/main/scala/org/apache/spark/ml/param/shared/sharedParams.scala
##########
@@ -562,4 +562,20 @@ trait HasBlockSize extends Params {
/** @group expertGetParam */
final def getBlockSize: Int = $(blockSize)
}
+
+/**
+ * Trait for shared param k. This trait may be changed or
+ * removed between minor versions.
+ */
+trait HasK extends Params {
+
+ /**
+ * Param for The number of clusters to create. Must be (> 1). Note that
it is possible for fewer than k clusters to be returned.
+ * @group param
+ */
+ final val k: IntParam = new IntParam(this, "k", "The number of clusters to
create. Must be (> 1). Note that it is possible for fewer than k clusters to be
returned", ParamValidators.gt(1))
+
+ /** @group getParam */
+ final def getK: Int = $(k)
Review comment:
If this isn't final, do you avoid the MiMa problems? they weren't final
before. I don't see why someone would override them, but, I suppose we can just
not change that.
##########
File path:
mllib/src/main/scala/org/apache/spark/ml/param/shared/sharedParams.scala
##########
@@ -562,4 +562,20 @@ trait HasBlockSize extends Params {
/** @group expertGetParam */
final def getBlockSize: Int = $(blockSize)
}
+
+/**
+ * Trait for shared param k. This trait may be changed or
+ * removed between minor versions.
+ */
+trait HasK extends Params {
+
+ /**
+ * Param for The number of clusters to create. Must be (> 1). Note that
it is possible for fewer than k clusters to be returned.
+ * @group param
+ */
+ final val k: IntParam = new IntParam(this, "k", "The number of clusters to
create. Must be (> 1). Note that it is possible for fewer than k clusters to be
returned", ParamValidators.gt(1))
Review comment:
Hm, I guess we lose the `@Since` annotations here. The latest one was
2.4.0. I guess we could say these methods are since 2.4.0, but the trait is
since 3.1.0, which might be confusing. I don't think it's a big deal but is a
minor downside to this refactoring.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]