-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-18110][PYTHON][ML] add missing parameter in Python for RandomForest regression and classification #15638
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -594,7 +594,7 @@ class RandomForestParams(TreeEnsembleParams): | |
| featureSubsetStrategy = \ | ||
| Param(Params._dummy(), "featureSubsetStrategy", | ||
| "The number of features to consider for splits at each tree node. Supported " + | ||
| "options: " + ", ".join(supportedFeatureSubsetStrategies) + " (0.0-1.0], [1-n].", | ||
| "options: " + ", ".join(supportedFeatureSubsetStrategies) + ", (0.0-1.0], [1-n].", | ||
| typeConverter=TypeConverters.toString) | ||
|
|
||
| def __init__(self): | ||
|
|
@@ -828,7 +828,7 @@ def featureImportances(self): | |
| @inherit_doc | ||
| class RandomForestRegressor(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPredictionCol, HasSeed, | ||
| RandomForestParams, TreeRegressorParams, HasCheckpointInterval, | ||
| JavaMLWritable, JavaMLReadable): | ||
| JavaMLWritable, JavaMLReadable, HasVarianceCol): | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you like to group all the
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. that doesn't seem to be the existing style, so adding to the end instead |
||
| """ | ||
| `Random Forest <http://en.wikipedia.org/wiki/Random_forest>`_ | ||
| learning algorithm for regression. | ||
|
|
@@ -876,13 +876,13 @@ def __init__(self, featuresCol="features", labelCol="label", predictionCol="pred | |
| maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, | ||
| maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, | ||
| impurity="variance", subsamplingRate=1.0, seed=None, numTrees=20, | ||
| featureSubsetStrategy="auto"): | ||
| featureSubsetStrategy="auto", varianceCol=None): | ||
| """ | ||
| __init__(self, featuresCol="features", labelCol="label", predictionCol="prediction", \ | ||
| maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \ | ||
| maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, \ | ||
| impurity="variance", subsamplingRate=1.0, seed=None, numTrees=20, \ | ||
| featureSubsetStrategy="auto") | ||
| featureSubsetStrategy="auto", varianceCol=None) | ||
| """ | ||
| super(RandomForestRegressor, self).__init__() | ||
| self._java_obj = self._new_java_obj( | ||
|
|
@@ -900,13 +900,13 @@ def setParams(self, featuresCol="features", labelCol="label", predictionCol="pre | |
| maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, | ||
| maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, | ||
| impurity="variance", subsamplingRate=1.0, seed=None, numTrees=20, | ||
| featureSubsetStrategy="auto"): | ||
| featureSubsetStrategy="auto", varianceCol=None): | ||
| """ | ||
| setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction", \ | ||
| maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \ | ||
| maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, \ | ||
| impurity="variance", subsamplingRate=1.0, seed=None, numTrees=20, \ | ||
| featureSubsetStrategy="auto") | ||
| featureSubsetStrategy="auto", varianceCol=None) | ||
| Sets params for linear regression. | ||
| """ | ||
| kwargs = self.setParams._input_kwargs | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some doc string tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally spark avoid having too many verbose tests in python doc string, so I think we are ok here.