Skip to content

Commit

Permalink
remove redundant comment
Browse files Browse the repository at this point in the history
  • Loading branch information
IndrajeetPatil committed May 11, 2024
1 parent fb7efec commit 1cfb801
Show file tree
Hide file tree
Showing 18 changed files with 7 additions and 22 deletions.
1 change: 0 additions & 1 deletion R/check_autocorrelation.R
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ check_autocorrelation <- function(x, ...) {
#' @rdname check_autocorrelation
#' @export
check_autocorrelation.default <- function(x, nsim = 1000, ...) {
# check for valid input
.is_model_valid(x)

.residuals <- stats::residuals(x)
Expand Down
1 change: 0 additions & 1 deletion R/check_collinearity.R
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ multicollinearity <- check_collinearity
#' @rdname check_collinearity
#' @export
check_collinearity.default <- function(x, ci = 0.95, verbose = TRUE, ...) {
# check for valid input
.is_model_valid(x)
.check_collinearity(x, component = "conditional", ci = ci, verbose = verbose)
}
Expand Down
1 change: 0 additions & 1 deletion R/check_convergence.R
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ check_convergence <- function(x, tolerance = 0.001, ...) {

#' @export
check_convergence.default <- function(x, tolerance = 0.001, ...) {
# check for valid input
.is_model_valid(x)
message(sprintf("`check_convergence()` does not work for models of class '%s'.", class(x)[1]))
}
Expand Down
1 change: 0 additions & 1 deletion R/check_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ check_distribution <- function(model) {

#' @export
check_distribution.default <- function(model) {
# check for valid input
.is_model_valid(model)

insight::check_if_installed("randomForest")
Expand Down
1 change: 0 additions & 1 deletion R/check_heteroscedasticity.R
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ check_heteroskedasticity <- check_heteroscedasticity

#' @export
check_heteroscedasticity.default <- function(x, ...) {
# check for valid input
.is_model_valid(x)

# only for linear models
Expand Down
1 change: 0 additions & 1 deletion R/check_itemscale.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
#' )
#' @export
check_itemscale <- function(x, factor_index = NULL) {
# check for valid input
if (!inherits(x, c("parameters_pca", "data.frame"))) {
insight::format_error(
"`x` must be an object of class `parameters_pca`, as returned by `parameters::principal_components()`, or a data frame." # nolint
Expand Down
1 change: 0 additions & 1 deletion R/check_normality.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ check_normality <- function(x, ...) {

#' @export
check_normality.default <- function(x, ...) {
# check for valid input
.is_model_valid(x)

if (!insight::model_info(x)$is_linear) {
Expand Down
1 change: 0 additions & 1 deletion R/check_overdispersion.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ check_overdispersion <- function(x, ...) {

#' @export
check_overdispersion.default <- function(x, ...) {
# check for valid input
.is_model_valid(x)
insight::format_error(
paste0("`check_overdisperion()` not yet implemented for models of class `", class(x)[1], "`.")
Expand Down
1 change: 0 additions & 1 deletion R/check_predictions.R
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,6 @@ check_predictions.default <- function(object,
type = "density",
verbose = TRUE,
...) {
# check for valid input
.is_model_valid(object)

# retrieve model information
Expand Down
4 changes: 2 additions & 2 deletions R/model_performance.bayesian.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ model_performance.stanreg <- function(model, metrics = "all", verbose = TRUE, ..
metrics <- c("LOOIC", "WAIC", "R2", "RMSE")
}

# check for valid input

metrics <- toupper(.check_bad_metrics(metrics, all_metrics, verbose))

algorithm <- insight::find_algorithm(model)
Expand Down Expand Up @@ -232,7 +232,7 @@ model_performance.BFBayesFactor <- function(model,
metrics <- all_metrics
}

# check for valid input

metrics <- toupper(.check_bad_metrics(metrics, all_metrics, verbose))

# check for valid BFBayesFactor object
Expand Down
2 changes: 1 addition & 1 deletion R/model_performance.bife.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ model_performance.bife <- function(model, metrics = "all", verbose = TRUE, ...)
metrics <- c("AIC", "R2")
}

# check for valid input

metrics <- .check_bad_metrics(metrics, all_metrics, verbose)

info <- insight::model_info(model)
Expand Down
2 changes: 1 addition & 1 deletion R/model_performance.ivreg.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ model_performance.ivreg <- function(model, metrics = "all", verbose = TRUE, ...)
metrics <- c("AIC", "BIC", "R2", "R2_adj", "RMSE")
}

# check for valid input

metrics <- .check_bad_metrics(metrics, all_metrics, verbose)

# the lm-method does not accept ivreg-specific metrics
Expand Down
2 changes: 1 addition & 1 deletion R/model_performance.lm.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ model_performance.lm <- function(model, metrics = "all", verbose = TRUE, ...) {
insight::formula_ok(model)
}

# check for valid input

metrics <- .check_bad_metrics(metrics, all_metrics, verbose)
info <- suppressWarnings(insight::model_info(model, verbose = FALSE))

Expand Down
2 changes: 1 addition & 1 deletion R/model_performance.mixed.R
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ model_performance.merMod <- function(model,
metrics <- c("AIC", "BIC", "R2", "ICC", "RMSE")
}

# check for valid input

metrics <- .check_bad_metrics(metrics, all_metrics, verbose)

# check model formula
Expand Down
4 changes: 1 addition & 3 deletions R/model_performance_default.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#' @export
model_performance.default <- function(model, metrics = "all", verbose = TRUE, ...) {
# check for valid input
.is_model_valid(model)

if (any(tolower(metrics) == "log_loss")) {
Expand All @@ -16,7 +15,7 @@ model_performance.default <- function(model, metrics = "all", verbose = TRUE, ..
metrics <- c("AIC", "BIC", "R2", "R2_adj", "RMSE")
}

# check for valid input

metrics <- .check_bad_metrics(metrics, all_metrics, verbose)

if (!insight::is_model(model) || !insight::is_model_supported(model)) {
Expand All @@ -32,7 +31,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)
if (length(bad_metrics)) {
if (verbose) {
Expand Down
2 changes: 0 additions & 2 deletions R/performance_aicc.R
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@ performance_aic <- function(x, ...) {
#' @rdname performance_aicc
#' @export
performance_aic.default <- function(x, estimator = "ML", verbose = TRUE, ...) {
# check for valid input
.is_model_valid(x)

info <- list(...)$model_info
Expand Down Expand Up @@ -203,7 +202,6 @@ AIC.bife <- function(object, ..., k = 2) {

#' @export
performance_aicc.default <- function(x, estimator = "ML", ...) {
# check for valid input
.is_model_valid(x)

# check ML estimator
Expand Down
1 change: 0 additions & 1 deletion R/performance_logloss.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ performance_logloss <- function(model, verbose = TRUE, ...) {

#' @export
performance_logloss.default <- function(model, verbose = TRUE, ...) {
# check for valid input
.is_model_valid(model)

resp <- .recode_to_zero(insight::get_response(model, verbose = verbose))
Expand Down
1 change: 0 additions & 1 deletion R/performance_mae.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ mae <- performance_mae

#' @export
performance_mae.default <- function(model, verbose = TRUE, ...) {
# check for valid input
.is_model_valid(model)

pred <- .safe(insight::get_predicted(model, ci = NULL, verbose = verbose, ...))
Expand Down

0 comments on commit 1cfb801

Please sign in to comment.