Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,5 @@ Additional_repositories:
https://stan-dev.r-universe.dev/
LazyData: TRUE
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.3
VignetteBuilder: knitr, rmarkdown
Config/roxygen2/version: 8.0.0
11 changes: 8 additions & 3 deletions R/methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#' the draws, while the aleatoric uncertainty from the data model is
#' not included. However, the estimated means of both methods averaged
#' across draws should be very similar.
#'
#'
#' The [proj_linpred()] function draws from the projected posterior of the
#' linear predictors, that is, draws before applying any link functions
#' or other transformations. These linear predictors can also be
Expand Down Expand Up @@ -639,6 +639,11 @@ proj_predict_aux <- function(proj, newdata, offsetnew, weightsnew,
return(structure(pppd_out, cats = cats_aug))
}

# Needed to avoid a NOTE in `R CMD check`:
if (getRversion() >= package_version("2.15.1")) {
utils::globalVariables("fontsize")
}

#' Plot predictive performance
#'
#' This is the [plot()] method for `vsel` objects (returned by [varsel()] or
Expand Down Expand Up @@ -1158,9 +1163,9 @@ plot.vsel <- function(
x_color_txt <- "black"
}
pp <- pp +
if (packageVersion("ggplot2") < "4.0.0") {
if (utils::packageVersion("ggplot2") < "4.0.0") {
geom_text(aes(y = -Inf, label = .data[["size_chr"]]), vjust = -0.5,
color = x_color_txt)
color = x_color_txt)
} else {
geom_text(aes(y = -Inf, label = .data[["size_chr"]],
size = from_theme(fontsize * 0.7)),
Expand Down
2 changes: 1 addition & 1 deletion man/as.matrix.projection.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/as_draws_matrix.projection.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/cl_agg.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/cv_varsel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/df_binom.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/df_gaussian.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/extend_family.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/mesquite.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/plot.cv_proportions.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions man/plot.vsel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/pred-projection.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/predict.refmodel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/project.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 8 additions & 7 deletions man/projpred-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/refmodel-init-get.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/varsel.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 11 additions & 4 deletions tests/testthat/test_datafit.R
Original file line number Diff line number Diff line change
Expand Up @@ -695,10 +695,17 @@ test_that(paste(
nterms = 0:nterms, refit_prj = FALSE)

# compute the results for the Lasso
lasso <- glmnet::glmnet(x, y_glmnet,
family = fam$family, weights = weights,
lambda.min.ratio = lambda_min_ratio,
nlambda = nlambda, thresh = 1e-12)
if (packageVersion("glmnet") < "5.0") {
lasso <- glmnet::glmnet(x, y_glmnet,
family = fam$family, weights = weights,
lambda.min.ratio = lambda_min_ratio,
nlambda = nlambda, thresh = 1e-12)
} else {
lasso <- glmnet::glmnet(x, y_glmnet,
family = fam$family, weights = weights,
lambda.min.ratio = lambda_min_ratio,
nlambda = nlambda, control = list(thresh = 1e-12))
}
predictor_ranking <- predict(lasso, type = "nonzero", s = lasso$lambda)
nselected <- sapply(predictor_ranking, function(e) length(e))
lambdainds <- sapply(unique(nselected), function(nterms) {
Expand Down
Loading
Loading