Skip to content
Closed
Changes from all commits
Commits
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 @@ -1050,8 +1050,11 @@ private[spark] object RandomForest extends Logging with Serializable {
// Calculate the expected number of samples for finding splits
val weightedNumSamples = samplesFractionForFindSplits(metadata) *
metadata.weightedNumExamples
// scale tolerance by number of samples with constant factor
// Note: constant factor was tuned by running some tests where there were no zero
// feature values and validating we are never within tolerance
val tolerance = Utils.EPSILON * unweightedNumSamples * 100
// add expected zero value count and get complete statistics
val tolerance = Utils.EPSILON * unweightedNumSamples * unweightedNumSamples
val valueCountMap = if (weightedNumSamples - partNumSamples > tolerance) {
partValueCountMap + (0.0 -> (weightedNumSamples - partNumSamples))
} else {
Expand Down