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

Yanbo Liang updated SPARK-17792:
--------------------------------
    Fix Version/s: 2.0.2

> L-BFGS solver for linear regression does not accept general numeric label 
> column types
> --------------------------------------------------------------------------------------
>
>                 Key: SPARK-17792
>                 URL: https://issues.apache.org/jira/browse/SPARK-17792
>             Project: Spark
>          Issue Type: Bug
>          Components: ML
>            Reporter: Seth Hendrickson
>            Assignee: Seth Hendrickson
>            Priority: Minor
>             Fix For: 2.0.2, 2.1.0
>
>
> There's a bug in accepting numeric types for linear regression. We cast the 
> label to {{DoubleType}} in one spot where we use normal solver, but not for 
> the l-bfgs solver. The following can reproduce the problem:
> {code}
> import org.apache.spark.ml.feature.LabeledPoint
> import org.apache.spark.ml.linalg.{Vector, DenseVector, Vectors}
> import org.apache.spark.ml.regression.LinearRegression
> import org.apache.spark.sql.types._
> val df = Seq(LabeledPoint(1.0, 
> Vectors.dense(1.0))).toDF().withColumn("weight", lit(1.0).cast(LongType))
> val lr = new LinearRegression().setSolver("l-bfgs").setWeightCol("weight")
> lr.fit(df)
> {code}



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