You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Imran Younus (JIRA)" <ji...@apache.org> on 2016/01/09 03:06:39 UTC

[jira] [Created] (SPARK-12732) Fix LinearRegression.train for the case when label is constant and fitIntercept=false

Imran Younus created SPARK-12732:
------------------------------------

             Summary: Fix LinearRegression.train for the case when label is constant and fitIntercept=false
                 Key: SPARK-12732
                 URL: https://issues.apache.org/jira/browse/SPARK-12732
             Project: Spark
          Issue Type: Bug
            Reporter: Imran Younus
            Priority: Minor


If the target variable is constant, then the linear regression must check if the fitIntercept is true or false, and handle these two cases separately.

If the fitIntercept is true, then there is no training needed and we set the intercept equal to the mean of y.

But if the fit intercept is false, then the model should still train.

Currently, LinearRegression handles both cases in the same way. It doesn't train the model and sets the intercept equal to the mean of y. Which, means that it returns a non-zero intercept even when the user forces the regression through the origin.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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