Skip to content

Commit

Permalink
fix style issue
Browse files Browse the repository at this point in the history
  • Loading branch information
actuaryzhang committed Jan 29, 2017
1 parent fb66ce0 commit 0d722fd
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions R/pkg/inst/tests/testthat/test_mllib_regression.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,13 @@ test_that("spark.glm and predict", {
prediction <- predict(model, training)
expect_equal(typeof(take(select(prediction, "prediction"), 1)$prediction), "double")
vals <- collect(select(prediction, "prediction"))

# manual calculation of the R predicted values to avoid dependence on statmod
# library(statmod)
# rModel <- glm(Sepal.Width ~ Sepal.Length + Species, data = iris,
# family = tweedie(var.power = 1.2, link.power = 1.0))
# print(coef(rModel))
#' library(statmod)
#' rModel <- glm(Sepal.Width ~ Sepal.Length + Species, data = iris,
#' family = tweedie(var.power = 1.2, link.power = 1.0))
#' print(coef(rModel))

rCoef <- c(1.7009682, 0.3436700, -0.9703189, -0.9852648)
rVals <- as.numeric(model.matrix(Sepal.Width ~ Sepal.Length + Species,
data = iris) %*% rCoef)
Expand Down

0 comments on commit 0d722fd

Please sign in to comment.