Skip to content

minor engine problems, DONE! #167

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 11, 2023
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
16 changes: 9 additions & 7 deletions R/make_quantile_reg.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#' @description
#' `quantile_reg()` generates a quantile regression model _specification_ for
#' the [tidymodels](https://www.tidymodels.org/) framework. Currently, the
#' only supported engine is [quantreg::rq()].
#' only supported engine is "rq" which uses [quantreg::rq()].
#'
#' @param mode A single character string for the type of model.
#' The only possible value for this model is "regression".
Expand Down Expand Up @@ -49,15 +49,15 @@ quantile_reg <- function(mode = "regression", engine = "rq", tau = 0.5) {
)
}


make_quantile_reg <- function() {
parsnip::set_new_model("quantile_reg")
parsnip::set_model_mode("quantile_reg", "regression")
parsnip::set_model_engine("quantile_reg", "regression", eng = "rq")
parsnip::set_dependency("quantile_reg", eng = "rq", pkg = "quantreg")



parsnip::set_model_engine("quantile_reg", "regression", eng = "rq")
parsnip::set_dependency("quantile_reg", eng = "rq", pkg = "quantreg")

parsnip::set_model_arg(
model = "quantile_reg",
eng = "rq",
Expand All @@ -73,10 +73,12 @@ make_quantile_reg <- function() {
mode = "regression",
value = list(
interface = "formula",
protect = c("formula", "data"),
protect = c("formula", "data", "weights"),
func = c(pkg = "quantreg", fun = "rq"),
defaults = list(method = "br", na.action = stats::na.omit,
model = FALSE)
defaults = list(
method = "br",
na.action = rlang::expr(stats::na.omit),
model = FALSE)
)
)

Expand Down
2 changes: 1 addition & 1 deletion man/quantile_reg.Rd

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