Github user srowen commented on a diff in the pull request:
https://github.com/apache/spark/pull/12360#discussion_r59567223
--- Diff: mllib/src/main/scala/org/apache/spark/ml/tree/treeParams.scala ---
@@ -397,8 +399,31 @@ private[spark] object RandomForestParams {
final val supportedFeatureSubsetStrategies: Array[String] =
Array("auto", "all", "onethird", "sqrt", "log2").map(_.toLowerCase)
- // The regex to capture "(0.0-1.0]", and "n" for integer 0 < n <=
(number of features)
- final val supportedFeatureSubsetStrategiesRegex =
"^(?:[1-9]\\d*|0?\\.\\d*[1-9]\\d*|1\\.0+)$"
+ object integerFeatureSubsetStrategy {
+ def unapply(strategy: String): Option[Int] = try {
+ val number = strategy.toInt
+ if (0 < number) {
--- End diff --
Nit: number > 0? and import java.lang.NumberFormatException
---
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 [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]