srowen commented on a change in pull request #25671: [SPARK-28968][ML] Add
HasNumFeatures in the scala side
URL: https://github.com/apache/spark/pull/25671#discussion_r320764082
##########
File path:
mllib/src/main/scala/org/apache/spark/ml/param/shared/sharedParams.scala
##########
@@ -274,6 +274,25 @@ trait HasOutputCols extends Params {
final def getOutputCols: Array[String] = $(outputCols)
}
+/**
+ * Trait for shared param numFeatures (default: 1 << 18). This trait may be
changed or
+ * removed between minor versions.
+ */
+@DeveloperApi
+trait HasNumFeatures extends Params {
+
+ /**
+ * Param for number of features..
+ * @group param
+ */
+ final val numFeatures: IntParam = new IntParam(this, "numFeatures", "number
of features.", ParamValidators.gt(0))
+
+ setDefault(numFeatures, 1 << 18)
+
+ /** @group getParam */
+ final def getNumFeatures: Int = $(numFeatures)
Review comment:
Hm, it was introduced in the subclasses in different versions. We could say
`@Since("2.3.0")` at least?
----------------------------------------------------------------
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]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]