Skip to content

Commit

Permalink
feat: detect linear trainer
Browse files Browse the repository at this point in the history
  • Loading branch information
dsweber2 committed Sep 14, 2023
1 parent ab64c1f commit ef4ea0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions R/layer_point_and_distn.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ layer_point_and_distn <- function(frosting, trainer, ...,
point_id = NULL,
point_type = c("median", "mean"),
truncate = c(-Inf, Inf),
use_predictive_distribution = FALSE,
use_predictive_distribution = TRUE,
dist_type = "gaussian") {
rlang::check_dots_empty()
stopifnot(inherits(recipe, "recipe"))
Expand Down Expand Up @@ -43,7 +43,7 @@ layer_point_and_distn <- function(frosting, trainer, ...,
if (is.null(distn_id)) {
distn_id <- rand_id("residual_quantiles")
}
if (use_predictive_distribution) {
if (inherits(trainer, "linear_reg") && use_predictive_distribution) {
frosting %<>% layer_residual_quantiles(
dist_type = dist_type,
name = distn_name,
Expand Down

0 comments on commit ef4ea0a

Please sign in to comment.