Skip to content
Snippets Groups Projects
Commit 629e26f7 authored by Feynman Liang's avatar Feynman Liang Committed by Joseph K. Bradley
Browse files

[SPARK-9609] [MLLIB] Fix spelling of Strategy.defaultStrategy

jkbradley

Author: Feynman Liang <fliang@databricks.com>

Closes #7941 from feynmanliang/SPARK-9609-stategy-spelling and squashes the following commits:

d2aafb1 [Feynman Liang] Add deprecated backwards compatibility
aa090a8 [Feynman Liang] Fix spelling
parent 7c8fc1f7
No related branches found
No related tags found
No related merge requests found
...@@ -163,7 +163,7 @@ private[ml] trait DecisionTreeParams extends PredictorParams { ...@@ -163,7 +163,7 @@ private[ml] trait DecisionTreeParams extends PredictorParams {
oldAlgo: OldAlgo.Algo, oldAlgo: OldAlgo.Algo,
oldImpurity: OldImpurity, oldImpurity: OldImpurity,
subsamplingRate: Double): OldStrategy = { subsamplingRate: Double): OldStrategy = {
val strategy = OldStrategy.defaultStategy(oldAlgo) val strategy = OldStrategy.defaultStrategy(oldAlgo)
strategy.impurity = oldImpurity strategy.impurity = oldImpurity
strategy.checkpointInterval = getCheckpointInterval strategy.checkpointInterval = getCheckpointInterval
strategy.maxBins = getMaxBins strategy.maxBins = getMaxBins
......
...@@ -90,7 +90,7 @@ object BoostingStrategy { ...@@ -90,7 +90,7 @@ object BoostingStrategy {
* @return Configuration for boosting algorithm * @return Configuration for boosting algorithm
*/ */
def defaultParams(algo: Algo): BoostingStrategy = { def defaultParams(algo: Algo): BoostingStrategy = {
val treeStrategy = Strategy.defaultStategy(algo) val treeStrategy = Strategy.defaultStrategy(algo)
treeStrategy.maxDepth = 3 treeStrategy.maxDepth = 3
algo match { algo match {
case Algo.Classification => case Algo.Classification =>
......
...@@ -178,14 +178,14 @@ object Strategy { ...@@ -178,14 +178,14 @@ object Strategy {
* @param algo "Classification" or "Regression" * @param algo "Classification" or "Regression"
*/ */
def defaultStrategy(algo: String): Strategy = { def defaultStrategy(algo: String): Strategy = {
defaultStategy(Algo.fromString(algo)) defaultStrategy(Algo.fromString(algo))
} }
/** /**
* Construct a default set of parameters for [[org.apache.spark.mllib.tree.DecisionTree]] * Construct a default set of parameters for [[org.apache.spark.mllib.tree.DecisionTree]]
* @param algo Algo.Classification or Algo.Regression * @param algo Algo.Classification or Algo.Regression
*/ */
def defaultStategy(algo: Algo): Strategy = algo match { def defaultStrategy(algo: Algo): Strategy = algo match {
case Algo.Classification => case Algo.Classification =>
new Strategy(algo = Classification, impurity = Gini, maxDepth = 10, new Strategy(algo = Classification, impurity = Gini, maxDepth = 10,
numClasses = 2) numClasses = 2)
...@@ -193,4 +193,8 @@ object Strategy { ...@@ -193,4 +193,8 @@ object Strategy {
new Strategy(algo = Regression, impurity = Variance, maxDepth = 10, new Strategy(algo = Regression, impurity = Variance, maxDepth = 10,
numClasses = 0) numClasses = 0)
} }
@deprecated("Use Strategy.defaultStrategy instead.", "1.5.0")
def defaultStategy(algo: Algo): Strategy = defaultStrategy(algo)
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment