Skip to content

document that main arguments are captured as quosures #918

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 4 commits into from
Mar 10, 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
1 change: 1 addition & 0 deletions R/auto_ml.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#' @param engine A single character string specifying what computational engine
#' to use for fitting.
#'
#' @templateVar modeltype auto_ml
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/bag_mars.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#'
#' @inheritParams mars
#'
#' @templateVar modeltype bag_mars
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/bag_mlp.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#'
#' @inheritParams mlp
#'
#' @templateVar modeltype bag_mlp
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/bag_tree.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#' factor is the minority class. If this is not the case, values between zero
#' and one can be used to bias to the second level of the factor.
#'
#' @templateVar modeltype bag_tree
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/bart.R
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#' terminal node for different values of these parameters.
#'
#'
#' @templateVar modeltype bart
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/boost_tree.R
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#' @param stop_iter The number of iterations without improvement before
#' stopping (specific engines only).
#'
#' @templateVar modeltype boost_tree
#' @template spec-details
#'
#' @template spec-references
Expand Down
2 changes: 2 additions & 0 deletions R/c5_rules.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
#'
#' @references Quinlan R (1993). _C4.5: Programs for Machine Learning_. Morgan
#' Kaufmann Publishers.
#'
#' @templateVar modeltype C5_rules
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/cubist_rules.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#' where `t` is the training set prediction and `w` is a weight that is inverse
#' to the distance to the neighbor.
#'
#' @templateVar modeltype cubist_rules
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/decision_tree.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#' @param min_n An integer for the minimum number of data points
#' in a node that are required for the node to be split further.
#'
#' @templateVar modeltype decision_tree
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/discrim_flexible.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#' @param prod_degree The highest possible interaction degree.
#' @param prune_method The pruning method.
#'
#' @templateVar modeltype discrim_flexible
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/discrim_linear.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#' estimation. Possible values are: "`diagonal`", "`min_distance`",
#' "`shrink_cov`", and "`shrink_mean`" (`sparsediscrim` engine only).
#'
#' @templateVar modeltype discrim_linear
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/discrim_quad.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#' estimation. Possible values are: "`diagonal`", "`shrink_cov`", and
#' "`shrink_mean`" (`sparsediscrim` engine only).
#'
#' @templateVar modeltype discrim_quad
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/discrim_regularized.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#' used. Other regularization methods can be used with [discrim_linear()] and
#' [discrim_quad()] can used via the `sparsediscrim` engine for those functions.
#'
#' @templateVar modeltype discrim_regularized
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/gen_additive_mod.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#' @param adjust_deg_free If `select_features = TRUE`, then acts as a multiplier
#' for smoothness. Increase this beyond 1 to produce smoother models.
#'
#' @templateVar modeltype gen_additive_mod
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/linear_reg.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#'
#' Available for specific engines only.
#'
#' @templateVar modeltype linear_reg
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/logistic_reg.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#' Available for specific engines only. For `LiblineaR` models, `mixture` must
#' be exactly 1 or 0 only.
#'
#' @templateVar modeltype logistic_reg
#' @template spec-details
#'
#' @details This model fits a classification model for binary outcomes; for
Expand Down
1 change: 1 addition & 0 deletions R/mars.R
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#' @param prod_degree The highest possible interaction degree.
#' @param prune_method The pruning method.
#'
#' @templateVar modeltype mars
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/mlp.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#' "linear" or "softmax" depending on the type of outcome. Possible values are:
#' "linear", "softmax", "relu", and "elu"
#'
#' @templateVar modeltype mlp
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/multinom_reg.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#'
#' Available for specific engines only.
#'
#' @templateVar modeltype multinom_reg
#' @template spec-details
#'
#' @details This model fits a classification model for multiclass outcomes; for
Expand Down
1 change: 1 addition & 0 deletions R/naive_Bayes.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#' @param Laplace A non-negative value for the Laplace correction to smoothing
#' low-frequency counts.
#'
#' @templateVar modeltype naive_Bayes
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/nearest_neighbor.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#' @param dist_power A single number for the parameter used in
#' calculating Minkowski distance.
#'
#' @templateVar modeltype nearest_neighbor
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/pls.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#' This value is used for all PLS components for X.
#' @param num_comp The number of PLS components to retain.
#'
#' @templateVar modeltype pls
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/poisson_reg.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#'
#' Available for `glmnet` and `spark` only.
#'
#' @templateVar modeltype poisson_reg
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/proportional_hazards.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#' @param mode A single character string for the prediction outcome mode.
#' The only possible value for this model is "censored regression".
#'
#' @templateVar modeltype proportional_hazards
#' @template spec-details
#'
#' @template spec-survival
Expand Down
1 change: 1 addition & 0 deletions R/rand_forest.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#' @param min_n An integer for the minimum number of data points
#' in a node that are required for the node to be split further.
#'
#' @templateVar modeltype rand_forest
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/rule_fit.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#' @references Friedman, J. H., and Popescu, B. E. (2008). "Predictive learning
#' via rule ensembles." _The Annals of Applied Statistics_, 2(3), 916-954.
#'
#' @templateVar modeltype rule_fit
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/surv_reg.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#' @param dist A character string for the probability distribution of the
#' outcome. The default is "weibull".
#'
#' @templateVar modeltype surv_reg
#' @template spec-details
#'
#' @template spec-survival
Expand Down
1 change: 1 addition & 0 deletions R/survival_reg.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#' outcome. The default is "weibull".
#'
#'
#' @templateVar modeltype survival_reg
#' @template spec-details
#'
#' @template spec-survival
Expand Down
1 change: 1 addition & 0 deletions R/svm_linear.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#' @param margin A positive number for the epsilon in the SVM insensitive
#' loss function (regression only)
#'
#' @templateVar modeltype svm_linear
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/svm_poly.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#' @param margin A positive number for the epsilon in the SVM insensitive
#' loss function (regression only)
#'
#' @templateVar modeltype svm_poly
#' @template spec-details
#'
#' @template spec-references
Expand Down
1 change: 1 addition & 0 deletions R/svm_rbf.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#' @param margin A positive number for the epsilon in the SVM insensitive
#' loss function (regression only)
#'
#' @templateVar modeltype svm_rbf
#' @template spec-details
#'
#' @template spec-references
Expand Down
9 changes: 9 additions & 0 deletions man-roxygen/spec-details.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,12 @@
#'
#' The model is not trained or fit until the [`fit()`][fit.model_spec()] function is used
#' with the data.
#'
#' Each of the arguments in this function other than `mode` and `engine` are
#' captured as [quosures][rlang::`topic-quosure`]. To pass values
#' programmatically, use the [injection operator][rlang::`!!`] like so:
#'
#' ``` r
#' value <- 1
#' <%= modeltype %>(argument = !!value)
#' ```
8 changes: 8 additions & 0 deletions man/C5_rules.Rd

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

8 changes: 8 additions & 0 deletions man/auto_ml.Rd

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

8 changes: 8 additions & 0 deletions man/bag_mars.Rd

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

8 changes: 8 additions & 0 deletions man/bag_mlp.Rd

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

8 changes: 8 additions & 0 deletions man/bag_tree.Rd

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

8 changes: 8 additions & 0 deletions man/bart.Rd

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

8 changes: 8 additions & 0 deletions man/boost_tree.Rd

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

8 changes: 8 additions & 0 deletions man/cubist_rules.Rd

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

8 changes: 8 additions & 0 deletions man/decision_tree.Rd

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

Loading