Github user BryanCutler commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11928#discussion_r57385094
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/regression/LinearRegression.scala ---
    @@ -412,11 +412,10 @@ class LinearRegressionModel private[ml] (
       def hasSummary: Boolean = trainingSummary.isDefined
     
       /**
    -   * Evaluates the model on a testset.
    +   * Evaluates the model on a test dataset.
        * @param dataset Test dataset to evaluate model on.
        */
    -  // TODO: decide on a good name before exposing to public API
    -  private[regression] def evaluate(dataset: DataFrame): 
LinearRegressionSummary = {
    +  def evaluate(dataset: DataFrame): LinearRegressionSummary = {
         // Handle possible missing or invalid prediction columns
         val (summaryModel, predictionColName) = 
findSummaryModelAndPredictionCol()
         new LinearRegressionSummary(summaryModel.transform(dataset), 
predictionColName,
    --- End diff --
    
    I think that `summaryModel` should be passed into the 
`LinearRegressionSummary` constructor instead of `this`.  I think I see the 
predictionCol used in `devianceResiduals`, so if it was just added in the 
`summaryModel`, it might fail.


---
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]

Reply via email to