Skip to content
Closed
Show file tree
Hide file tree
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 @@ -496,7 +496,7 @@ private class AFTAggregator(parameters: BDV[Double], fitIntercept: Boolean)
* @return This AFTAggregator object.
*/
def merge(other: AFTAggregator): this.type = {
if (other.count != 0) {
if (totalCnt != 0) {
totalCnt += other.totalCnt
lossSum += other.lossSum

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -346,18 +346,6 @@ class AFTSurvivalRegressionSuite
testEstimatorAndModelReadWrite(aft, datasetMultivariate,
AFTSurvivalRegressionSuite.allParamSettings, checkModelData)
}

test("SPARK-15892: Incorrectly merged AFTAggregator with zero total count") {
// This `dataset` will contain an empty partition because it has two rows but
// the parallelism is bigger than that. Because the issue was about `AFTAggregator`s
// being merged incorrectly when it has an empty partition, running the codes below
// should not throw an exception.
val dataset = spark.createDataFrame(
sc.parallelize(generateAFTInput(
1, Array(5.5), Array(0.8), 2, 42, 1.0, 2.0, 2.0), numSlices = 3))
val trainer = new AFTSurvivalRegression()
trainer.fit(dataset)
}
}

object AFTSurvivalRegressionSuite {
Expand Down