Skip to content

Commit d60823f

Browse files
committed
change the default value of featureSubsetStrategy to "all" in GBTClassifier and GBTRegressor
1 parent 0631f8d commit d60823f

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

python/pyspark/ml/classification.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@ class GBTClassifier(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPredictionCol
12011201
>>> td = si_model.transform(df)
12021202
>>> gbt = GBTClassifier(maxIter=5, maxDepth=2, labelCol="indexed", seed=42)
12031203
>>> gbt.getFeatureSubsetStrategy()
1204-
'auto'
1204+
'all'
12051205
>>> model = gbt.fit(td)
12061206
>>> model.featureImportances
12071207
SparseVector(1, {0: 1.0})
@@ -1256,21 +1256,21 @@ def __init__(self, featuresCol="features", labelCol="label", predictionCol="pred
12561256
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
12571257
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, lossType="logistic",
12581258
maxIter=20, stepSize=0.1, seed=None, subsamplingRate=1.0,
1259-
featureSubsetStrategy="auto"):
1259+
featureSubsetStrategy="all"):
12601260
"""
12611261
__init__(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
12621262
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \
12631263
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, \
12641264
lossType="logistic", maxIter=20, stepSize=0.1, seed=None, subsamplingRate=1.0, \
1265-
featureSubsetStrategy="auto")
1265+
featureSubsetStrategy="all")
12661266
"""
12671267
super(GBTClassifier, self).__init__()
12681268
self._java_obj = self._new_java_obj(
12691269
"org.apache.spark.ml.classification.GBTClassifier", self.uid)
12701270
self._setDefault(maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
12711271
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10,
12721272
lossType="logistic", maxIter=20, stepSize=0.1, subsamplingRate=1.0,
1273-
featureSubsetStrategy="auto")
1273+
featureSubsetStrategy="all")
12741274
kwargs = self._input_kwargs
12751275
self.setParams(**kwargs)
12761276

@@ -1280,13 +1280,13 @@ def setParams(self, featuresCol="features", labelCol="label", predictionCol="pre
12801280
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
12811281
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10,
12821282
lossType="logistic", maxIter=20, stepSize=0.1, seed=None, subsamplingRate=1.0,
1283-
featureSubsetStrategy="auto"):
1283+
featureSubsetStrategy="all"):
12841284
"""
12851285
setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
12861286
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \
12871287
maxMemoryInMB=256, cacheNodeIds=False, checkpointInterval=10, \
12881288
lossType="logistic", maxIter=20, stepSize=0.1, seed=None, subsamplingRate=1.0, \
1289-
featureSubsetStrategy="auto")
1289+
featureSubsetStrategy="all")
12901290
Sets params for Gradient Boosted Tree Classification.
12911291
"""
12921292
kwargs = self._input_kwargs

python/pyspark/ml/regression.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ class GBTRegressor(JavaEstimator, HasFeaturesCol, HasLabelCol, HasPredictionCol,
10411041
>>> print(gbt.getImpurity())
10421042
variance
10431043
>>> print(gbt.getFeatureSubsetStrategy())
1044-
auto
1044+
all
10451045
>>> model = gbt.fit(df)
10461046
>>> model.featureImportances
10471047
SparseVector(1, {0: 1.0})
@@ -1092,20 +1092,20 @@ def __init__(self, featuresCol="features", labelCol="label", predictionCol="pred
10921092
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
10931093
maxMemoryInMB=256, cacheNodeIds=False, subsamplingRate=1.0,
10941094
checkpointInterval=10, lossType="squared", maxIter=20, stepSize=0.1, seed=None,
1095-
impurity="variance", featureSubsetStrategy="auto"):
1095+
impurity="variance", featureSubsetStrategy="all"):
10961096
"""
10971097
__init__(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
10981098
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \
10991099
maxMemoryInMB=256, cacheNodeIds=False, subsamplingRate=1.0, \
11001100
checkpointInterval=10, lossType="squared", maxIter=20, stepSize=0.1, seed=None, \
1101-
impurity="variance", featureSubsetStrategy="auto")
1101+
impurity="variance", featureSubsetStrategy="all")
11021102
"""
11031103
super(GBTRegressor, self).__init__()
11041104
self._java_obj = self._new_java_obj("org.apache.spark.ml.regression.GBTRegressor", self.uid)
11051105
self._setDefault(maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
11061106
maxMemoryInMB=256, cacheNodeIds=False, subsamplingRate=1.0,
11071107
checkpointInterval=10, lossType="squared", maxIter=20, stepSize=0.1,
1108-
impurity="variance", featureSubsetStrategy="auto")
1108+
impurity="variance", featureSubsetStrategy="all")
11091109
kwargs = self._input_kwargs
11101110
self.setParams(**kwargs)
11111111

@@ -1115,13 +1115,13 @@ def setParams(self, featuresCol="features", labelCol="label", predictionCol="pre
11151115
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0,
11161116
maxMemoryInMB=256, cacheNodeIds=False, subsamplingRate=1.0,
11171117
checkpointInterval=10, lossType="squared", maxIter=20, stepSize=0.1, seed=None,
1118-
impuriy="variance", featureSubsetStrategy="auto"):
1118+
impuriy="variance", featureSubsetStrategy="all"):
11191119
"""
11201120
setParams(self, featuresCol="features", labelCol="label", predictionCol="prediction", \
11211121
maxDepth=5, maxBins=32, minInstancesPerNode=1, minInfoGain=0.0, \
11221122
maxMemoryInMB=256, cacheNodeIds=False, subsamplingRate=1.0, \
11231123
checkpointInterval=10, lossType="squared", maxIter=20, stepSize=0.1, seed=None, \
1124-
impurity="variance", featureSubsetStrategy="auto")
1124+
impurity="variance", featureSubsetStrategy="all")
11251125
Sets params for Gradient Boosted Tree Regression.
11261126
"""
11271127
kwargs = self._input_kwargs

0 commit comments

Comments
 (0)