Skip to content

Commit ff95b1e

Browse files
committed
udpates for new documentation system
1 parent ea2c4ef commit ff95b1e

File tree

3 files changed

+52
-36
lines changed

3 files changed

+52
-36
lines changed

R/gen_additive_mod.R

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,18 @@
44
# - mode = "regression" (default) uses
55
# - mode = "classification"
66

7-
#' Interface for Generalized Additive Models (GAM)
7+
#' Generalized additive models (GAMs)
88
#'
9-
#' @param mode A single character string for the type of model.
9+
#' `gen_additive_mod()` defines a model that can use smoothed functions of
10+
#' numeric predictors in a generalized linear model.
11+
#'
12+
#' There are different ways to fit this model. See the engine-specific pages
13+
#' for more details
14+
#'
15+
#' More information on how `parsnip` is used for modeling is at
16+
#' \url{https://www.tidymodels.org}.
17+
#'
18+
#' @inheritParams boost_tree
1019
#' @param select_features TRUE or FALSE. If this is TRUE then can add an
1120
#' extra penalty to each term so that it can be penalized to zero.
1221
#' This means that the smoothing parameter estimation that is part of
@@ -22,20 +31,11 @@
2231
#'
2332
#' @details
2433
#'
25-
#' __Available Engines:__
26-
#' - __gam__: Connects to `mgcv::gam()`
34+
#' This function only defines what _type_ of model is being fit. Once an engine
35+
#' is specified, the _method_ to fit the model is also defined.
2736
#'
28-
#' __Parameter Mapping:__
29-
#'
30-
#' ```{r echo = FALSE}
31-
#' tibble::tribble(
32-
#' ~ "modelgam", ~ "mgcv::gam",
33-
#' "select_features", "select (FALSE)",
34-
#' "adjust_deg_free", "gamma (1)"
35-
#' ) %>% knitr::kable()
36-
#' ```
37-
#'
38-
#' @section Engine Details:
37+
#' The model is not trained or fit until the [fit.model_spec()] function is used
38+
#' with the data.
3939
#'
4040
#' __gam__
4141
#'
@@ -61,7 +61,8 @@
6161
#' fit(value ~ s(date_mon, k = 12) + s(date_num), data = df)
6262
#' ```
6363
#'
64-
#'
64+
#' @references \url{https://www.tidymodels.org},
65+
#' [_Tidy Models with R_](https://tmwr.org)
6566
#' @examples
6667
#'
6768
#' show_engines("gen_additive_mod")
@@ -92,7 +93,7 @@ gen_additive_mod <- function(mode = "regression",
9293

9394
#' @export
9495
print.gen_additive_mod <- function(x, ...) {
95-
cat("GAM Model Specification (", x$mode, ")\n\n", sep = "")
96+
cat("GAM Specification (", x$mode, ")\n\n", sep = "")
9697
model_printer(x, ...)
9798

9899
if(!is.null(x$method$fit$args)) {
@@ -104,6 +105,7 @@ print.gen_additive_mod <- function(x, ...) {
104105
}
105106

106107
#' @export
108+
#' @rdname parsnip_update
107109
#' @importFrom stats update
108110
update.gen_additive_mod <- function(object,
109111
select_features = NULL,

man/gen_additive_mod.Rd

Lines changed: 19 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/parsnip_update.Rd

Lines changed: 14 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)