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

    https://github.com/apache/spark/pull/16699#discussion_r100917713
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/ml/regression/GeneralizedLinearRegression.scala
 ---
    @@ -1139,54 +1189,52 @@ class GeneralizedLinearRegressionSummary 
private[regression] (
     
       /** Degrees of freedom. */
       @Since("2.0.0")
    -  lazy val degreesOfFreedom: Long = {
    -    numInstances - rank
    -  }
    +  lazy val degreesOfFreedom: Long = numInstances - rank
     
       /** The residual degrees of freedom. */
       @Since("2.0.0")
       lazy val residualDegreeOfFreedom: Long = degreesOfFreedom
     
       /** The residual degrees of freedom for the null model. */
       @Since("2.0.0")
    -  lazy val residualDegreeOfFreedomNull: Long = if (model.getFitIntercept) {
    -    numInstances - 1
    -  } else {
    -    numInstances
    +  lazy val residualDegreeOfFreedomNull: Long = {
    +    if (model.getFitIntercept) numInstances - 1 else numInstances
       }
     
    -  private def weightCol: Column = {
    -    if (!model.isDefined(model.weightCol) || model.getWeightCol.isEmpty) {
    -      lit(1.0)
    -    } else {
    -      col(model.getWeightCol)
    -    }
    +  private def label: Column = col(model.getLabelCol).cast(DoubleType)
    +
    +  private def prediction: Column = col(predictionCol)
    +
    +  private def weight: Column = {
    +    if (!isSetWeightCol(model)) lit(1.0) else col(model.getWeightCol)
    --- End diff --
    
    This is computed differently than before. Is there a reason why? 


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