Skip to content

Commit c76c823

Browse files
committed
added migration guide for mllib
1 parent abe5ed7 commit c76c823

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

docs/mllib-guide.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,30 @@ To use MLlib in Python, you will need [NumPy](http://www.numpy.org) version 1.4
6262

6363
# Migration Guide
6464

65+
## From 1.1 to 1.2
66+
67+
The only API changes in MLlib v1.2 are in
68+
[`DecisionTree`](api/scala/index.html#org.apache.spark.mllib.tree.DecisionTree),
69+
which continues to be an experimental API in MLlib 1.2:
70+
71+
1. *(Breaking change)* The Scala API for classification takes a named argument specifying the number
72+
of classes. In MLlib v1.1, this argument was called `numClasses` in Python and
73+
`numClassesForClassification` in Scala. In MLlib v1.2, the names are both set to `numClasses`.
74+
This `numClasses` parameter is specified either via
75+
[`Strategy`](api/scala/index.html#org.apache.spark.mllib.tree.configuration.Strategy)
76+
or via [`DecisionTree`](api/scala/index.html#org.apache.spark.mllib.tree.DecisionTree)
77+
static `trainClassifier` and `trainRegressor` methods.
78+
79+
2. *(Breaking change)* The API for
80+
[`Node`](api/scala/index.html#org.apache.spark.mllib.tree.model.Node) has changed.
81+
This should generally not affect user code, unless the user manually constructs decision trees
82+
(instead of using the `trainClassifier` or `trainRegressor` methods).
83+
The tree `Node` now includes more information, including the probability of the predicted label
84+
(for classification).
85+
86+
Examples in the Spark distribution and examples in the
87+
[Decision Trees Guide](mllib-decision-tree.html#examples) have been updated accordingly.
88+
6589
## From 1.0 to 1.1
6690

6791
The only API changes in MLlib v1.1 are in

mllib/src/main/scala/org/apache/spark/mllib/tree/configuration/BoostingStrategy.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ object BoostingStrategy {
8585
case "Regression" =>
8686
new BoostingStrategy(treeStrategy, SquaredError)
8787
case _ =>
88-
throw new IllegalArgumentException(s"$algo is not supported by the boosting.")
88+
throw new IllegalArgumentException(s"$algo is not supported by boosting.")
8989
}
9090
}
9191
}

0 commit comments

Comments
 (0)