[ 
https://issues.apache.org/jira/browse/SPARK-12732?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

DB Tsai resolved SPARK-12732.
-----------------------------
       Resolution: Fixed
    Fix Version/s: 2.0.0

Issue resolved by pull request 10702
[https://github.com/apache/spark/pull/10702]

> 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
>          Components: MLlib
>            Reporter: Imran Younus
>            Assignee: Imran Younus
>            Priority: Minor
>             Fix For: 2.0.0
>
>
> 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-unsubscr...@spark.apache.org
For additional commands, e-mail: issues-h...@spark.apache.org

Reply via email to