Github user yanboliang commented on the pull request:

    https://github.com/apache/spark/pull/9303#issuecomment-151536352
  
    This PR depends on #9302 , after it merged I will add this test case which 
has passed on my local test environment.
    ```R
    test_that("summary coefficients match with native glm of Logistic 
Regression", {
      df <- createDataFrame(sqlContext, iris)
      training <- filter(df, df$Species != "setosa")
      stats <- summary(glm(Species ~ Sepal_Length + Sepal_Width, data = 
training, family = "binomial"))
      coefs <- as.vector(stats$coefficients)
    
      rTraining <- iris[iris$Species %in% c("versicolor","virginica"),]
      rCoefs <- as.vector(coef(glm(Species ~ Sepal.Length + Sepal.Width, data = 
rTraining,
        family = binomial(link = "logit"))))
    
      expect_true(all(abs(rCoefs - coefs) < 1e-4))
      expect_true(all(
        as.character(stats$features) ==
        c("(Intercept)", "Sepal_Length", "Sepal_Width")))
    })
    ``` 


---
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 [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to