Github user tengpeng commented on a diff in the pull request: https://github.com/apache/spark/pull/19638#discussion_r148641672 --- Diff: mllib/src/test/scala/org/apache/spark/ml/evaluation/RegressionEvaluatorSuite.scala --- @@ -73,6 +73,11 @@ class RegressionEvaluatorSuite evaluator.setMetricName("r2") assert(evaluator.evaluate(predictions) ~== 0.9998387 absTol 0.01) + // Adjusted r2 + evaluator.setMetricName("r2adj") + assert(evaluator.evaluate(predictions) ~== 0.9998 absTol 0.01) + print(evaluator.evaluate(predictions)) --- End diff -- > Alternatively, you can just compute n from the size of one of the stats vectors. I tried this. In old `RegressionMetrics`, only `y` related information is passed, observed `y_i` & fitted `\hat{y}`. The length of `x` is sent from `MultivariateStatisticalSummary` but the width does not. Maybe I am missing something here. Do you have any hints to get the width of `x` using `states vectors`?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org