Github user actuaryzhang commented on the issue:

    https://github.com/apache/spark/pull/16740
  
    The following is a simple example to illustrate the issue. 
    
    ```
    val dataset = Seq(
              (1.0, 1.0, 2.0, 0.0, 5.0),
              (0.5, 2.0, 1.0, 1.0, 2.0),
              (1.0, 3.0, 0.5, 2.0, 1.0),
              (2.0, 4.0, 1.5, 3.0, 3.0)
            ).toDF("y", "w", "off", "x1", "x2")
    
    val formula = new RFormula().setFormula("y ~ 1")
    val output = formula.fit(dataset).transform(dataset)
    val glr = new GeneralizedLinearRegression().setFamily("poisson")
    val model = glr.fit(output)
    ```
    
    The above prints out the following error message:
    ```
    java.lang.UnsupportedOperationException: empty.reduceLeft
      at 
scala.collection.TraversableOnce$class.reduceLeft(TraversableOnce.scala:180)
      at 
scala.collection.mutable.ArrayOps$ofDouble.scala$collection$IndexedSeqOptimized$$super$reduceLeft(ArrayOps.scala:270)
      at 
scala.collection.IndexedSeqOptimized$class.reduceLeft(IndexedSeqOptimized.scala:74)
    ```


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org
For additional commands, e-mail: reviews-h...@spark.apache.org

Reply via email to