Skip to content

Commit

Permalink
edit lr_beta_constraints test to use CheckGLMModel2 to validate
Browse files Browse the repository at this point in the history
  • Loading branch information
Amy Wang committed Feb 27, 2015
1 parent 58864a5 commit af82376
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions R/tests/testdir_jira/runit_hex_2020_LR_beta_constraints.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,8 @@ test.LR.betaConstraints <- function(conn) {
xMatrix_age = as.matrix(xDataFrame)
lr.R = glmnet(x = xMatrix_age, alpha = 0., lambda = lr.h2o@model$lambda, standardize = T,
y = prostate.csv[,"CAPSULE"], family = "gaussian", lower.limits = 0., upper.limits = 1.)
checkGLMModel2(lr.h2o, lr.R)

compare_deviance(lr.h2o, lr.R)
compare_coeff(lr.h2o, lr.R)

#### shift AGE coefficient by 0.002
Log.info("Test Beta Constraints with negative upper bound in H2O...")
lower_bound = -0.007
Expand All @@ -55,8 +53,7 @@ test.LR.betaConstraints <- function(conn) {
lr_negativeUpper.R = glmnet(x = xMatrix_age, alpha = 0., lambda = lr.h2o@model$lambda, standardize = T,
y = prostate.csv[,"CAPSULE"], family = "gaussian", lower.limits = lower_bound-upper_bound, upper.limits = 0.)

compare_deviance(lr_negativeUpper.h2o, lr_negativeUpper.R)
compare_coeff(lr_negativeUpper.h2o, lr_negativeUpper.R)
checkGLMModel2(lr_negativeUpper.h2o, lr_negativeUpper.R)

testEnd()
}
Expand Down

0 comments on commit af82376

Please sign in to comment.