[SPARK-18177][ML][PYSPARK] Add missing 'subsamplingRate' of pyspark GBTClassifier
## What changes were proposed in this pull request? Add missing 'subsamplingRate' of pyspark GBTClassifier ## How was this patch tested? existing tests Author: Zheng RuiFeng <ruifengz@foxmail.com> Closes #15692 from zhengruifeng/gbt_subsamplingRate.
This commit is contained in:
parent
0ea5d5b24c
commit
9dc9f9a5dd
|
@ -900,19 +900,19 @@ class GBTClassifier(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPredictionCol
|
|||
def __init__(self, featuresCol="features", labelCol="label", predictionCol="prediction",
|
||||
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
|
||||
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, lossType="logistic",
|
||||
maxIter=20, stepSize=0.1, seed=None):
|
||||
maxIter=20, stepSize=0.1, seed=None, subsamplingRate=1.0):
|
||||
"""
|
||||
__init__(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
|
||||
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \
|
||||
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, \
|
||||
lossType="logistic", maxIter=20, stepSize=0.1, seed=None)
|
||||
lossType="logistic", maxIter=20, stepSize=0.1, seed=None, subsamplingRate=1.0)
|
||||
"""
|
||||
super(GBTClassifier, self).__init__()
|
||||
self._java_obj = self._new_java_obj(
|
||||
"org.apache.spark.ml.classification.GBTClassifier", self.uid)
|
||||
self._setDefault(maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
|
||||
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10,
|
||||
lossType="logistic", maxIter=20, stepSize=0.1)
|
||||
lossType="logistic", maxIter=20, stepSize=0.1, subsamplingRate=1.0)
|
||||
kwargs = self.__init__._input_kwargs
|
||||
self.setParams(**kwargs)
|
||||
|
||||
|
@ -921,12 +921,12 @@ class GBTClassifier(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPredictionCol
|
|||
def setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction",
|
||||
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
|
||||
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10,
|
||||
lossType="logistic", maxIter=20, stepSize=0.1, seed=None):
|
||||
lossType="logistic", maxIter=20, stepSize=0.1, seed=None, subsamplingRate=1.0):
|
||||
"""
|
||||
setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
|
||||
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \
|
||||
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, \
|
||||
lossType="logistic", maxIter=20, stepSize=0.1, seed=None)
|
||||
lossType="logistic", maxIter=20, stepSize=0.1, seed=None, subsamplingRate=1.0)
|
||||
Sets params for Gradient Boosted Tree Classification.
|
||||
"""
|
||||
kwargs = self.setParams._input_kwargs
|
||||
|
|
Loading…
Reference in a new issue