Skip to content

Commit

Permalink
styler
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil committed Feb 24, 2022
1 parent ab7fb7f commit 36d3dc7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion R/check_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#'
#' @examples
#' if (require("lme4") && require("parameters") &&
#' require("see") && require("patchwork") && require("randomForest")) {
#' require("see") && require("patchwork") && require("randomForest")) {
#' data(sleepstudy)
#'
#' model <<- lmer(Reaction ~ Days + (Days | Subject), sleepstudy)
Expand Down
3 changes: 0 additions & 3 deletions R/model_performance_default.R
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ model_performance.default <- function(model, metrics = "all", verbose = TRUE, ..




.check_bad_metrics <- function(metrics, all_metrics, verbose = TRUE) {
# check for valid input
bad_metrics <- which(!metrics %in% all_metrics)
Expand All @@ -44,5 +43,3 @@ model_performance.default <- function(model, metrics = "all", verbose = TRUE, ..
metrics
}


# default methods -----------------------
7 changes: 4 additions & 3 deletions tests/testthat/test-model_performance.merMod.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ if (requiet("testthat") && requiet("insight") && requiet("performance") && requi


test_that("model_performance.merMod AICc", {
m1 <- lmer(mpg ~ disp + am + (1|cyl), data = mtcars)
m1 <- lmer(mpg ~ disp + am + (1 | cyl), data = mtcars)
m2 <- lm(mpg ~ hp + vs, data = mtcars)

expect_equal(compare_performance(m1, m2, metrics = "AICc")$AICc,
c(177.52804, 182.88598),
tolerance = 1e-3)
c(177.52804, 182.88598),
tolerance = 1e-3
)
expect_equal(model_performance(m1, metrics = "AICc")$AICc, 177.52804, tolerance = 1e-3)
expect_equal(performance_aicc(m1), 177.52804, tolerance = 1e-3)
})
Expand Down

0 comments on commit 36d3dc7

Please sign in to comment.