Skip to content
Open
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
1db47ef
[SPARK-34591][MLLIB] Disable decision tree pruning
Jun 8, 2021
36a3527
Merge branch 'master' into SPARK-34591
Jun 8, 2021
6e52df6
[SPARK-34591][MLLIB] Disable decision tree pruning
Jun 8, 2021
b53c0e4
Merge branch 'master' into SPARK-34591
Jun 8, 2021
6898a0e
This PR disables a feature created in SPARK-3159 where LearningNodes …
Jun 8, 2021
2fc33ec
Merge branch 'master' into SPARK-34591
Jun 8, 2021
fb835db
Exposed pruning parameter accessible in Scala WIP
CBribiescas Jun 14, 2021
a471d5e
Merge branch 'master' into SPARK-34591
CBribiescas Jun 14, 2021
43ee852
Added to decision tree classifier and to python
CBribiescas Jun 20, 2021
dcec830
Merge branch 'master' into SPARK-34591
CBribiescas Jun 20, 2021
4bb58f6
Finished a TODO for comments in Strategy.scala
CBribiescas Jun 20, 2021
ea028d4
Merge branch 'master' into SPARK-34591
CBribiescas Jul 8, 2021
f51bbae
Merge branch 'master' into SPARK-34591
CBribiescas Sep 1, 2021
86aa0c2
merge master
WeichenXu123 May 7, 2026
3ab5b2e
address conflicts
WeichenXu123 May 7, 2026
85f3da4
default pruneTree false
WeichenXu123 May 7, 2026
e5a7896
update test
WeichenXu123 May 7, 2026
84498d2
address comments
WeichenXu123 May 7, 2026
6bb95f2
default prune true
WeichenXu123 May 8, 2026
3a7945f
since 4.3.0
WeichenXu123 May 8, 2026
d48462a
Merge branch 'master' into SPARK-34591
WeichenXu123 May 8, 2026
f38aed0
Merge branch 'master' into SPARK-34591
WeichenXu123 May 11, 2026
f03eba1
address comments
WeichenXu123 May 11, 2026
a0d86fd
fix
WeichenXu123 May 11, 2026
10fb923
fix binary compatibility
WeichenXu123 May 11, 2026
a7088de
mima
WeichenXu123 May 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ class DecisionTreeClassifier @Since("1.4.0") (
@Since("1.4.0")
def setMinInfoGain(value: Double): this.type = set(minInfoGain, value)

/** @group setParam */
@Since("4.3.0")
def setPruneTree(value: Boolean): this.type = set(pruneTree, value)

/** @group expertSetParam */
@Since("1.4.0")
def setMaxMemoryInMB(value: Int): this.type = set(maxMemoryInMB, value)
Expand Down Expand Up @@ -134,9 +138,11 @@ class DecisionTreeClassifier @Since("1.4.0") (

val strategy = getOldStrategy(categoricalFeatures, numClasses)
require(!strategy.bootstrap, "DecisionTreeClassifier does not need bootstrap sampling")
strategy.pruneTree = $(pruneTree)

instr.logNumClasses(numClasses)
instr.logParams(this, labelCol, featuresCol, predictionCol, rawPredictionCol,
probabilityCol, leafCol, maxDepth, maxBins, minInstancesPerNode, minInfoGain,
probabilityCol, leafCol, maxDepth, maxBins, minInstancesPerNode, minInfoGain, pruneTree,
maxMemoryInMB, cacheNodeIds, checkpointInterval, impurity, seed, thresholds)

val trees = RandomForest.run(instances, strategy, numTrees = 1, featureSubsetStrategy = "all",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ class RandomForestClassifier @Since("1.4.0") (
@Since("1.4.0")
def setMinInfoGain(value: Double): this.type = set(minInfoGain, value)

/** @group setParam */
@Since("4.3.0")
def setPruneTree(value: Boolean): this.type = set(pruneTree, value)

/** @group expertSetParam */
@Since("1.4.0")
def setMaxMemoryInMB(value: Int): this.type = set(maxMemoryInMB, value)
Expand Down Expand Up @@ -159,10 +163,11 @@ class RandomForestClassifier @Since("1.4.0") (
val strategy =
super.getOldStrategy(categoricalFeatures, numClasses, OldAlgo.Classification, getOldImpurity)
strategy.bootstrap = $(bootstrap)
strategy.pruneTree = $(pruneTree)

instr.logParams(this, labelCol, featuresCol, weightCol, predictionCol, probabilityCol,
rawPredictionCol, leafCol, impurity, numTrees, featureSubsetStrategy, maxDepth, maxBins,
maxMemoryInMB, minInfoGain, minInstancesPerNode, minWeightFractionPerNode, seed,
maxMemoryInMB, minInfoGain, pruneTree, minInstancesPerNode, minWeightFractionPerNode, seed,
subsamplingRate, thresholds, cacheNodeIds, checkpointInterval, bootstrap)

val trees = RandomForest
Expand Down
Loading
Loading