You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/10/12 01:46:55 UTC

[GitHub] [spark] zhengruifeng commented on a change in pull request #30000: [SPARK-33111][ML] aft transform optimization

zhengruifeng commented on a change in pull request #30000:
URL: https://github.com/apache/spark/pull/30000#discussion_r502999821



##########
File path: mllib/src/main/scala/org/apache/spark/ml/regression/AFTSurvivalRegression.scala
##########
@@ -421,9 +421,17 @@ class AFTSurvivalRegressionModel private[ml] (
     }
 
     if (hasQuantilesCol) {
-      val predictQuantilesUDF = udf { features: Vector => predictQuantiles(features)}
+      val baseQuantiles = $(quantileProbabilities)
+        .map(q => math.exp(math.log(-math.log1p(-q)) * scale))
+      val lambdaCol = if ($(predictionCol).nonEmpty) {

Review comment:
       if ($(predictionCol).nonEmpty), then `predictionColumns.head` is `predictUDF(col($(featuresCol))).as($(predictionCol), outputSchema($(predictionCol)).metadata)`, the predictionCol.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org