Skip to content

Conversation

@yanboliang
Copy link
Contributor

Like ml LinearRegression, LogisticRegression should provide a training summary including feature names and their coefficients.

@yanboliang
Copy link
Contributor Author

This PR depends on #9302 , after it merged I will add this test case which has passed on my local test environment.

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")))
})

@SparkQA
Copy link

SparkQA commented Oct 27, 2015

Test build #44438 has finished for PR 9303 at commit 9261dcb.

  • This patch fails MiMa tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@SparkQA
Copy link

SparkQA commented Oct 28, 2015

Test build #44511 has finished for PR 9303 at commit 56bd22d.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@mengxr
Copy link
Contributor

mengxr commented Nov 3, 2015

@yanboliang Could you rebase master?

@SparkQA
Copy link

SparkQA commented Nov 4, 2015

Test build #44995 has finished for PR 9303 at commit af3e7c7.

  • This patch fails Spark unit tests.
  • This patch merges cleanly.
  • This patch adds no public classes.

@yanboliang
Copy link
Contributor Author

Jenkins, test this please.

@SparkQA
Copy link

SparkQA commented Nov 4, 2015

Test build #45005 has finished for PR 9303 at commit af3e7c7.

  • This patch passes all tests.
  • This patch merges cleanly.
  • This patch adds the following public classes (experimental):\n * case class ExecutorLostFailure(\n

@mengxr
Copy link
Contributor

mengxr commented Nov 4, 2015

LGTM. Merged into master. Thanks!

@asfgit asfgit closed this in e328b69 Nov 4, 2015
@yanboliang yanboliang deleted the spark-9492 branch November 5, 2015 01:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants