Github user jkbradley commented on a diff in the pull request:
https://github.com/apache/spark/pull/3951#discussion_r23500737
--- Diff: python/pyspark/mllib/tree.py ---
@@ -383,6 +387,129 @@ def trainRegressor(cls, data,
categoricalFeaturesInfo, numTrees, featureSubsetSt
featureSubsetStrategy, impurity, maxDepth,
maxBins, seed)
+class GradientBoostedTreesModel(TreeEnsembleModel):
+ """
+ Represents a gradient-boosted tree model.
+
+ EXPERIMENTAL: This is an experimental API.
+ It will probably be modified in future.
+ """
+
+
+class GradientBoostedTrees(object):
+
+ @classmethod
+ def _train(cls, data, algo, categoricalFeaturesInfo,
+ loss, numIterations, learningRate, maxDepth):
+ first = data.first()
+ assert isinstance(first, LabeledPoint), "the data should be RDD of
LabeledPoint"
+ model = callMLlibFunc("trainGradientBoostedTreesModel", data,
algo, categoricalFeaturesInfo,
+ loss, numIterations, learningRate, maxDepth)
+ return GradientBoostedTreesModel(model)
+
+ @classmethod
+ def trainClassifier(cls, data, categoricalFeaturesInfo,
--- End diff --
Can you please use the same defaults as in the Scala API (here and for
trainRegressor)?
---
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]