Github user imatiach-msft commented on a diff in the pull request:
https://github.com/apache/spark/pull/16652#discussion_r98516538
--- Diff:
mllib/src/test/scala/org/apache/spark/ml/regression/AFTSurvivalRegressionSuite.scala
---
@@ -400,6 +400,17 @@ class AFTSurvivalRegressionSuite
val trainer = new AFTSurvivalRegression()
trainer.fit(dataset)
}
+
+ test("SPARK-19234: Fail fast on zero-valued labels") {
+ val dataset = spark.createDataFrame(Seq(
+ (1.218, 1.0, Vectors.dense(1.560, -0.605)),
+ (0.000, 0.0, Vectors.dense(0.346, 2.158)), // â generates
error; zero labels invalid
+ (4.199, 0.0, Vectors.dense(0.795, -0.226)))).toDF("label",
"censor", "features")
+ val aft = new AFTSurvivalRegression()
+ intercept[SparkException] {
--- End diff --
it's recommended to verify the error message using withClue, eg:
withClue("label of AFTPoint must be positive") {
intercept[SparkException] {
aft.fit(dataset)
}
}
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]