You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by sethah <gi...@git.apache.org> on 2016/03/31 00:55:57 UTC
[GitHub] spark pull request: [SPARK-3724][ML] RandomForest: More options fo...
Github user sethah commented on a diff in the pull request:
https://github.com/apache/spark/pull/11989#discussion_r57977742
--- Diff: mllib/src/main/scala/org/apache/spark/ml/tree/treeParams.scala ---
@@ -360,7 +362,9 @@ private[ml] trait RandomForestParams extends TreeEnsembleParams {
"The number of features to consider for splits at each tree node." +
s" Supported options: ${RandomForestParams.supportedFeatureSubsetStrategies.mkString(", ")}",
(value: String) =>
- RandomForestParams.supportedFeatureSubsetStrategies.contains(value.toLowerCase))
+ RandomForestParams.supportedFeatureSubsetStrategies.contains(value.toLowerCase)
+ || (try { value.toInt > 0 } catch { case _ : Throwable => false })
--- End diff --
This could be simplified using a regex. I think the following pattern should work: `"0?\\.\\d+|1.0+|\\d+"`
---
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