Skip to content

Commit

Permalink
add test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
GlenMartin31 committed Apr 24, 2023
1 parent 60c5d80 commit 518819f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion tests/testthat/_snaps/pred_stacked_regression.md
Expand Up @@ -8,7 +8,7 @@
Model Coefficients
=================================
Intercept Age SexM Smoking_Status Diabetes Creatine
1 -2.67512 0.005346913 0.1589209 0.5232909 0.2542794 0.4553747
1 -2.675134 0.005345728 0.1589948 0.5233706 0.2543348 0.4554044
Model Functional Form
=================================
Expand Down
7 changes: 5 additions & 2 deletions tests/testthat/test-pred_stacked_regression.R
Expand Up @@ -13,13 +13,16 @@ test_that("pred_stacked_regression has expected output", {

SR <- pred_stacked_regression(x = LogisticModels,
new_data = SYNPM$ValidationData,
binary_outcome = "Y")
binary_outcome = "Y",
positivity_constraint = FALSE)
expect_type(SR, type = "list")
expect_equal(names(SR), c("M", "model_type", "coefs", "coef_names", "formula", "model_info", "Stacked_Regression_Weights"))
expect_s3_class(SR, "predSR")
expect_s3_class(SR, "predinfo_logistic")
expect_s3_class(SR, "predinfo")

expect_snapshot(summary(SR))

SR <- pred_stacked_regression(x = LogisticModels,
new_data = SYNPM$ValidationData,
binary_outcome = "Y",
Expand All @@ -30,7 +33,7 @@ test_that("pred_stacked_regression has expected output", {
expect_s3_class(SR, "predinfo_logistic")
expect_s3_class(SR, "predinfo")

expect_snapshot(summary(SR))



TTModels <- pred_input_info(model_type = "survival",
Expand Down

0 comments on commit 518819f

Please sign in to comment.