Skip to content

Commit ed5a2df

Browse files
committed
fixed classification requirements
1 parent d012be7 commit ed5a2df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mllib/src/main/scala/org/apache/spark/mllib/tree/DecisionTree.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,9 +1093,9 @@ object DecisionTree extends Serializable with Logging {
10931093
*/
10941094
if (strategy.categoricalFeaturesInfo.size > 0) {
10951095
val maxCategoriesForFeatures = strategy.categoricalFeaturesInfo.maxBy(_._2)._2
1096-
require(numBins >= maxCategoriesForFeatures)
1096+
require(numBins > maxCategoriesForFeatures)
10971097
if (strategy.isMultiClassification) {
1098-
require(numBins > math.pow(2, maxCategoriesForFeatures.toInt) - 1)
1098+
require(numBins > math.pow(2, maxCategoriesForFeatures.toInt - 1) - 1)
10991099
}
11001100
}
11011101

0 commit comments

Comments
 (0)