Skip to content

Commit

Permalink
fixed classification requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
manishamde committed May 13, 2014
1 parent d012be7 commit ed5a2df
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1093,9 +1093,9 @@ object DecisionTree extends Serializable with Logging {
*/
if (strategy.categoricalFeaturesInfo.size > 0) {
val maxCategoriesForFeatures = strategy.categoricalFeaturesInfo.maxBy(_._2)._2
require(numBins >= maxCategoriesForFeatures)
require(numBins > maxCategoriesForFeatures)
if (strategy.isMultiClassification) {
require(numBins > math.pow(2, maxCategoriesForFeatures.toInt) - 1)
require(numBins > math.pow(2, maxCategoriesForFeatures.toInt - 1) - 1)
}
}

Expand Down

0 comments on commit ed5a2df

Please sign in to comment.