Skip to content

Commit 36497e6

Browse files
authored
Merge pull request #294 from tidymodels/no-sexpr
removed Sexpr and use includeRmd
2 parents b58e42f + 7f854e2 commit 36497e6

40 files changed

+1389
-780
lines changed

.travis.yml

Lines changed: 0 additions & 59 deletions
This file was deleted.

R/boost_tree.R

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -59,38 +59,7 @@
5959
#' }
6060
#'
6161
#'
62-
#' @section Engine Details:
63-
#'
64-
#' The standardized parameter names in parsnip can be mapped to their original
65-
#' names in each engine:
66-
#'
67-
#' ```{r echo = FALSE}
68-
#' convert_args("boost_tree")
69-
#' ```
70-
#'
71-
#' Engines may have pre-set default arguments when executing the
72-
#' model fit call. For this type of model, the template of the
73-
#' fit calls are:
74-
#'
75-
#' \pkg{xgboost} classification
76-
#'
77-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::boost_tree(mode = "classification"), "xgboost")}
78-
#'
79-
#' \pkg{xgboost} regression
80-
#'
81-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::boost_tree(mode = "regression"), "xgboost")}
82-
#'
83-
#' \pkg{C5.0} classification
84-
#'
85-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::boost_tree(mode = "classification"), "C5.0")}
86-
#'
87-
#' \pkg{spark} classification
88-
#'
89-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::boost_tree(mode = "classification"), "spark")}
90-
#'
91-
#' \pkg{spark} regression
92-
#'
93-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::boost_tree(mode = "regression"), "spark")}
62+
#' @includeRmd man/rmd/boost-tree.Rmd details
9463
#'
9564
#' @note For models created using the spark engine, there are
9665
#' several differences to consider. First, only the formula
@@ -106,7 +75,7 @@
10675
#' reloaded and reattached to the `parsnip` object.
10776
#'
10877
#' @importFrom purrr map_lgl
109-
#' @seealso [[fit()], [set_engine()]
78+
#' @seealso [fit()], [set_engine()]
11079
#' @examples
11180
#' boost_tree(mode = "classification", trees = 20)
11281
#' # Parameters can be represented by a placeholder:

R/decision_tree.R

Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -44,38 +44,7 @@
4444
#' greater than 30 `rpart` will give nonsense results on 32-bit
4545
#' machines.
4646
#'
47-
#' @section Engine Details:
48-
#'
49-
#' The standardized parameter names in parsnip can be mapped to their original
50-
#' names in each engine:
51-
#'
52-
#' ```{r echo = FALSE}
53-
#' convert_args("decision_tree")
54-
#' ```
55-
#'
56-
#' Engines may have pre-set default arguments when executing the
57-
#' model fit call. For this type of
58-
#' model, the template of the fit calls are::
59-
#'
60-
#' \pkg{rpart} classification
61-
#'
62-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::decision_tree(mode = "classification"), "rpart")}
63-
#'
64-
#' \pkg{rpart} regression
65-
#'
66-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::decision_tree(mode = "regression"), "rpart")}
67-
#'
68-
#' \pkg{C5.0} classification
69-
#'
70-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::decision_tree(mode = "classification"), "C5.0")}
71-
#'
72-
#' \pkg{spark} classification
73-
#'
74-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::decision_tree(mode = "classification"), "spark")}
75-
#'
76-
#' \pkg{spark} regression
77-
#'
78-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::decision_tree(mode = "regression"), "spark")}
47+
#' @includeRmd man/rmd/decision-tree.Rmd details
7948
#'
8049
#' @note For models created using the spark engine, there are
8150
#' several differences to consider. First, only the formula
@@ -91,7 +60,7 @@
9160
#' reloaded and reattached to the `parsnip` object.
9261
#'
9362
#' @importFrom purrr map_lgl
94-
#' @seealso [[fit()]
63+
#' @seealso [fit()]
9564
#' @examples
9665
#' decision_tree(mode = "classification", tree_depth = 5)
9766
#' # Parameters can be represented by a placeholder:

R/linear_reg.R

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -42,57 +42,7 @@
4242
#' \item \pkg{keras}: `"keras"`
4343
#' }
4444
#'
45-
#' @section Engine Details:
46-
#'
47-
#' The standardized parameter names in parsnip can be mapped to their original
48-
#' names in each engine:
49-
#'
50-
#' ```{r echo = FALSE}
51-
#' convert_args("linear_reg")
52-
#' ```
53-
#'
54-
#' Engines may have pre-set default arguments when executing the
55-
#' model fit call. For this type of
56-
#' model, the template of the fit calls are:
57-
#'
58-
#' \pkg{lm}
59-
#'
60-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::linear_reg(), "lm")}
61-
#'
62-
#' \pkg{glmnet}
63-
#'
64-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::linear_reg(), "glmnet")}
65-
#'
66-
#' \pkg{stan}
67-
#'
68-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::linear_reg(), "stan")}
69-
#'
70-
#' (note that the `refresh` default prevents logging of the estimation process. Change this value in `set_engine()` will show the logs)
71-
#'
72-
#' \pkg{spark}
73-
#'
74-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::linear_reg(), "spark")}
75-
#'
76-
#' \pkg{keras}
77-
#'
78-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::linear_reg(), "keras")}
79-
#'
80-
#' For `glmnet` models, the full regularization path is always fit regardless
81-
#' of the value given to `penalty`. Also, there is the option to pass
82-
#' multiple values (or no values) to the `penalty` argument. When using the
83-
#' `predict()` method in these cases, the return value depends on
84-
#' the value of `penalty`. When using `predict()`, only a single
85-
#' value of the penalty can be used. When predicting on multiple
86-
#' penalties, the `multi_predict()` function can be used. It
87-
#' returns a tibble with a list column called `.pred` that contains
88-
#' a tibble with all of the penalty results.
89-
#'
90-
#' For prediction, the `stan` engine can compute posterior
91-
#' intervals analogous to confidence and prediction intervals. In
92-
#' these instances, the units are the original outcome and when
93-
#' `std_error = TRUE`, the standard deviation of the posterior
94-
#' distribution (or posterior predictive distribution as
95-
#' appropriate) is returned.
45+
#' @includeRmd man/rmd/linear-reg.Rmd details
9646
#'
9747
#' @note For models created using the spark engine, there are
9848
#' several differences to consider. First, only the formula

R/logistic_reg.R

Lines changed: 1 addition & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -40,58 +40,7 @@
4040
#' \item \pkg{keras}: `"keras"`
4141
#' }
4242
#'
43-
#' @section Engine Details:
44-
#'
45-
#' The standardized parameter names in parsnip can be mapped to their original
46-
#' names in each engine:
47-
#'
48-
#' ```{r echo = FALSE}
49-
#' convert_args("logistic_reg")
50-
#' ```
51-
#'
52-
#' Engines may have pre-set default arguments when executing the
53-
#' model fit call. For this type of
54-
#' model, the template of the fit calls are:
55-
#'
56-
#' \pkg{glm}
57-
#'
58-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::logistic_reg(), "glm")}
59-
#'
60-
#' \pkg{glmnet}
61-
#'
62-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::logistic_reg(), "glmnet")}
63-
#'
64-
#' \pkg{stan}
65-
#'
66-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::logistic_reg(), "stan")}
67-
#'
68-
#' (note that the `refresh` default prevents logging of the estimation process. Change this value in `set_engine()` will show the logs)
69-
#'
70-
#' \pkg{spark}
71-
#'
72-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::logistic_reg(), "spark")}
73-
#'
74-
#' \pkg{keras}
75-
#'
76-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::logistic_reg(), "keras")}
77-
#'
78-
#' For `glmnet` models, the full regularization path is always fit regardless
79-
#' of the value given to `penalty`. Also, there is the option to pass
80-
#' multiple values (or no values) to the `penalty` argument. When using the
81-
#' `predict()` method in these cases, the return value depends on
82-
#' the value of `penalty`. When using `predict()`, only a single
83-
#' value of the penalty can be used. When predicting on multiple
84-
#' penalties, the `multi_predict()` function can be used. It
85-
#' returns a tibble with a list column called `.pred` that contains
86-
#' a tibble with all of the penalty results.
87-
#'
88-
#' For prediction, the `stan` engine can compute posterior
89-
#' intervals analogous to confidence and prediction intervals. In
90-
#' these instances, the units are the original outcome and when
91-
#' `std_error = TRUE`, the standard deviation of the posterior
92-
#' distribution (or posterior predictive distribution as
93-
#' appropriate) is returned. For `glm`, the standard error is in logit units
94-
#' while the intervals are in probability units.
43+
#' @includeRmd man/rmd/logistic-reg.Rmd details
9544
#'
9645
#' @note For models created using the spark engine, there are
9746
#' several differences to consider. First, only the formula

R/mars.R

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -36,30 +36,7 @@
3636
#' \item \pkg{R}: `"earth"` (the default)
3737
#' }
3838
#'
39-
#' @section Engine Details:
40-
#'
41-
#' The standardized parameter names in parsnip can be mapped to their original
42-
#' names in each engine:
43-
#'
44-
#' ```{r echo = FALSE}
45-
#' convert_args("mars")
46-
#' ```
47-
#'
48-
#' Engines may have pre-set default arguments when executing the
49-
#' model fit call. For this type of
50-
#' model, the template of the fit calls are:
51-
#'
52-
#' \pkg{earth} classification
53-
#'
54-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::mars(mode = "classification"), "earth")}
55-
#'
56-
#' \pkg{earth} regression
57-
#'
58-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::mars(mode = "regression"), "earth")}
59-
#'
60-
#' Note that, when the model is fit, the \pkg{earth} package only has its
61-
#' namespace loaded. However, if `multi_predict` is used, the package is
62-
#' attached.
39+
#' @includeRmd man/rmd/mars.Rmd details
6340
#'
6441
#' @importFrom purrr map_lgl
6542
#' @seealso [fit()]

R/mlp.R

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -51,37 +51,7 @@
5151
#' \item \pkg{keras}: `"keras"`
5252
#' }
5353
#'
54-
#' An error is thrown if both `penalty` and `dropout` are specified for
55-
#' `keras` models.
56-
#'
57-
#' @section Engine Details:
58-
#'
59-
#' The standardized parameter names in parsnip can be mapped to their original
60-
#' names in each engine:
61-
#'
62-
#' ```{r echo = FALSE}
63-
#' convert_args("mlp")
64-
#' ```
65-
#'
66-
#' Engines may have pre-set default arguments when executing the
67-
#' model fit call. For this type of
68-
#' model, the template of the fit calls are:
69-
#'
70-
#' \pkg{keras} classification
71-
#'
72-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::mlp(mode = "classification"), "keras")}
73-
#'
74-
#' \pkg{keras} regression
75-
#'
76-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::mlp(mode = "regression"), "keras")}
77-
#'
78-
#' \pkg{nnet} classification
79-
#'
80-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::mlp(mode = "classification"), "nnet")}
81-
#'
82-
#' \pkg{nnet} regression
83-
#'
84-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::mlp(mode = "regression"), "nnet")}
54+
#' @includeRmd man/rmd/mlp.Rmd details
8555
#'
8656
#' @importFrom purrr map_lgl
8757
#' @seealso [fit()]

R/multinom_reg.R

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -39,44 +39,7 @@
3939
#' \item \pkg{keras}: `"keras"`
4040
#' }
4141
#'
42-
#' @section Engine Details:
43-
#'
44-
#' The standardized parameter names in parsnip can be mapped to their original
45-
#' names in each engine:
46-
#'
47-
#' ```{r echo = FALSE}
48-
#' convert_args("multinom_reg")
49-
#' ```
50-
#'
51-
#' Engines may have pre-set default arguments when executing the
52-
#' model fit call. For this type of
53-
#' model, the template of the fit calls are:
54-
#'
55-
#' \pkg{glmnet}
56-
#'
57-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::multinom_reg(), "glmnet")}
58-
#'
59-
#' \pkg{nnet}
60-
#'
61-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::multinom_reg(), "nnet")}
62-
#'
63-
#' \pkg{spark}
64-
#'
65-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::multinom_reg(), "spark")}
66-
#'
67-
#' \pkg{keras}
68-
#'
69-
#' \Sexpr[results=rd]{parsnip:::show_fit(parsnip:::multinom_reg(), "keras")}
70-
#'
71-
#' For `glmnet` models, the full regularization path is always fit regardless
72-
#' of the value given to `penalty`. Also, there is the option to pass
73-
#' multiple values (or no values) to the `penalty` argument. When using the
74-
#' `predict()` method in these cases, the return value depends on
75-
#' the value of `penalty`. When using `predict()`, only a single
76-
#' value of the penalty can be used. When predicting on multiple
77-
#' penalties, the `multi_predict()` function can be used. It
78-
#' returns a tibble with a list column called `.pred` that contains
79-
#' a tibble with all of the penalty results.
42+
#' @includeRmd man/rmd/multinom-reg.Rmd details
8043
#'
8144
#' @note For models created using the spark engine, there are
8245
#' several differences to consider. First, only the formula

0 commit comments

Comments
 (0)