You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Weichen Xu (JIRA)" <ji...@apache.org> on 2017/08/15 10:31:01 UTC

[jira] [Updated] (SPARK-21681) MLOR do not work correctly when featureStd contains zero

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

Weichen Xu updated SPARK-21681:
-------------------------------
    Description: 
MLOR do not work correctly when featureStd contains zero.
We can reproduce the bug through such dataset (features including zero variance), will generate wrong result (all coefficients becomes 0)

{code}
    val multinomialDatasetWithZeroVar = {
      val nPoints = 100
      val coefficients = Array(
        -0.57997, 0.912083, -0.371077,
        -0.16624, -0.84355, -0.048509)

      val xMean = Array(5.843, 3.0)
      val xVariance = Array(0.6856, 0.0)  // including zero variance

      val testData = generateMultinomialLogisticInput(
        coefficients, xMean, xVariance, addIntercept = true, nPoints, seed)

      val df = sc.parallelize(testData, 4).toDF().withColumn("weight", lit(1.0))
      df.cache()
      df
    }
{code}



  was:MLOR do not work correctly when featureStd contains zero.


> MLOR do not work correctly when featureStd contains zero
> --------------------------------------------------------
>
>                 Key: SPARK-21681
>                 URL: https://issues.apache.org/jira/browse/SPARK-21681
>             Project: Spark
>          Issue Type: Bug
>          Components: ML
>    Affects Versions: 2.2.0
>            Reporter: Weichen Xu
>
> MLOR do not work correctly when featureStd contains zero.
> We can reproduce the bug through such dataset (features including zero variance), will generate wrong result (all coefficients becomes 0)
> {code}
>     val multinomialDatasetWithZeroVar = {
>       val nPoints = 100
>       val coefficients = Array(
>         -0.57997, 0.912083, -0.371077,
>         -0.16624, -0.84355, -0.048509)
>       val xMean = Array(5.843, 3.0)
>       val xVariance = Array(0.6856, 0.0)  // including zero variance
>       val testData = generateMultinomialLogisticInput(
>         coefficients, xMean, xVariance, addIntercept = true, nPoints, seed)
>       val df = sc.parallelize(testData, 4).toDF().withColumn("weight", lit(1.0))
>       df.cache()
>       df
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

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