Skip to content

Commit d68b765

Browse files
authored
remove superfluous backticks across pkg documentation (#1158)
--------- Co-authored-by: Luis Verde Arregoitia <[email protected]>
1 parent c7dc696 commit d68b765

28 files changed

+547
-53
lines changed

R/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
# Some Notes on the Design of `parsnip`
1+
# Some Notes on the Design of parsnip
22

3-
`parsnip` is trying to solve the issues of unified interfaces for the myriad R modeling functions that have very heterogeneous interfaces and return values. It defines a set of modules, which are specific tasks, such as
3+
The parsnip package is trying to solve the issues of unified interfaces for the myriad R modeling functions that have very heterogeneous interfaces and return values. It defines a set of modules, which are specific tasks, such as
44

55
* fitting the model
66
* obtaining numeric predictions for regression models
77
* computing different types of predictions for classification and censored regression models
88

99
and so on. The list of modules is likely to grow over time to include variable importance scores and so on,.
1010

11-
`caret` was written for the same purpose. The approach there was to encapsulate the modules as functions (see [this directory](https://github.com/topepo/caret/tree/master/models/files) for examples). The issue with having these modules as functions are:
11+
The caret package was written for the same purpose. The approach there was to encapsulate the modules as functions (see [this directory](https://github.com/topepo/caret/tree/master/models/files) for examples). The issue with having these modules as functions are:
1212

1313
* A lot of code duplication.
1414
* More difficult to maintain.
1515
* Any functions in open code had to be a dependency of some sort. This led to a long ago version having about 200 package dependencies which was problematic.
1616

17-
To get around the last point, `caret` _compiles_ these modules into a large list and saves it in the package as an RData file. This avoids `R CMD check` from noticing that code and triggering warnings about dependencies.
17+
To get around the last point, caret _compiles_ these modules into a large list and saves it in the package as an RData file. This avoids `R CMD check` from noticing that code and triggering warnings about dependencies.
1818

1919
## Model Fitting Modules
2020

21-
`parsnip` approaches the problem differently and relies more on using `call` objects for the modules. In the simple cases, the fit module is a list that contains information about the module including the package and function name for the call as well as any default options. For example, for logistic regression using `glm`, the module may look like:
21+
parsnip approaches the problem differently and relies more on using `call` objects for the modules. In the simple cases, the fit module is a list that contains information about the module including the package and function name for the call as well as any default options. For example, for logistic regression using `glm`, the module may look like:
2222

2323
```r
2424
list(
@@ -77,9 +77,9 @@ The same is true for quosures.
7777

7878
Making predictions is done in a manner similar to fitting models; a call is created in the same way. However, there are additional complexities.
7979

80-
First, the data or model fit object may require some preprocessing to make the predict function work. This does _not_ include executing a formula method on the data but may include coercing the new data into an appropriate format. It can also be used to check for specific fit object requirements. For example, an additional option is required for the `ranger` package to compute class probabilities. The `pre` element of a prediction module can be used to check that the relevant option is set correctly.
80+
First, the data or model fit object may require some preprocessing to make the predict function work. This does _not_ include executing a formula method on the data but may include coercing the new data into an appropriate format. It can also be used to check for specific fit object requirements. For example, an additional option is required for the ranger package to compute class probabilities. The `pre` element of a prediction module can be used to check that the relevant option is set correctly.
8181

82-
Second, there is a high likelihood that the results of executing the prediction code will require post-processing to put the results into a usable format. `ranger`, for example, returns an object of specific class that contains the predicted values for the new data. The `post` element of the prediction module would extract this value and put it into a more consistent format.
82+
Second, there is a high likelihood that the results of executing the prediction code will require post-processing to put the results into a usable format. ranger, for example, returns an object of specific class that contains the predicted values for the new data. The `post` element of the prediction module would extract this value and put it into a more consistent format.
8383

8484
The postprocessor can also be used to coerce the results into a [_tidy format_](https://tidymodels.github.io/model-implementation-principles/model-predictions.html#return-values).
8585

R/aaa_models.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ check_interface_val <- function(x) {
511511
#' and `raw`.
512512
#' @param pkg An options character string for a package name.
513513
#' @param parsnip A single character string for the "harmonized" argument name
514-
#' that `parsnip` exposes.
514+
#' that parsnip exposes.
515515
#' @param original A single character string for the argument name that
516516
#' underlying model function uses.
517517
#' @param value A list that conforms to the `fit_obj` or `pred_obj` description
@@ -525,7 +525,7 @@ check_interface_val <- function(x) {
525525
#' @keywords internal
526526
#' @details These functions are available for users to add their
527527
#' own models or engines (in a package or otherwise) so that they can
528-
#' be accessed using `parsnip`. This is more thoroughly documented
528+
#' be accessed using parsnip. This is more thoroughly documented
529529
#' on the package web site (see references below).
530530
#'
531531
#' In short, `parsnip` stores an environment object that contains

R/add_in.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' Start an RStudio Addin that can write model specifications
22
#'
33
#' `parsnip_addin()` starts a process in the RStudio IDE Viewer window
4-
#' that allows users to write code for `parsnip` model specifications from
4+
#' that allows users to write code for parsnip model specifications from
55
#' various R packages. The new code is written to the current document at the
66
#' location of the cursor.
77
#'

R/engines.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ load_libs <- function(x, quiet, attach = FALSE) {
7272
#'
7373
#' - _Main arguments_ are more commonly used and tend to be available across
7474
#' engines. These names are standardized to work with different engines in a
75-
#' consistent way, so you can use the \pkg{parsnip} main argument `trees`,
75+
#' consistent way, so you can use the parsnip main argument `trees`,
7676
#' instead of the heterogeneous arguments for this parameter from \pkg{ranger}
7777
#' and \pkg{randomForest} packages (`num.trees` and `ntree`, respectively). Set
7878
#' these in your model type function, like `rand_forest(trees = 2000)`.
@@ -154,10 +154,10 @@ set_engine.default <- function(object, engine, ...) {
154154
#' Display currently available engines for a model
155155
#'
156156
#' The possible engines for a model can depend on what packages are loaded.
157-
#' Some \pkg{parsnip} extension add engines to existing models. For example,
157+
#' Some parsnip extension add engines to existing models. For example,
158158
#' the \pkg{poissonreg} package adds additional engines for the [poisson_reg()]
159159
#' model and these are not available unless \pkg{poissonreg} is loaded.
160-
#' @param x The name of a `parsnip` model (e.g., "linear_reg", "mars", etc.)
160+
#' @param x The name of a parsnip model (e.g., "linear_reg", "mars", etc.)
161161
#' @return A tibble.
162162
#'
163163
#' @examplesIf !parsnip:::is_cran_check()

R/extract.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#' importance/explainers.
3131
#'
3232
#' However, users should not invoke the `predict()` method on an extracted
33-
#' model. There may be preprocessing operations that `parsnip` has executed on
33+
#' model. There may be preprocessing operations that parsnip has executed on
3434
#' the data prior to giving it to the model. Bypassing these can lead to errors
3535
#' or silently generating incorrect predictions.
3636
#'

R/model_object_docs.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
#' software will be used. It can be a package name or a technology
3939
#' type.
4040
#'
41-
#' This class and structure is the basis for how \pkg{parsnip}
41+
#' This class and structure is the basis for how parsnip
4242
#' stores model objects prior to seeing the data.
4343
#'
4444
#' @section Argument Details:
@@ -53,7 +53,7 @@
5353
#' arguments. For example, when calling `mean(dat_vec)`, the object
5454
#' `dat_vec` is immediately evaluated inside of the function.
5555
#'
56-
#' `parsnip` model functions do not do this. For example, using
56+
#' parsnip model functions do not do this. For example, using
5757
#'
5858
#'\preformatted{
5959
#' rand_forest(mtry = ncol(mtcars) - 1)

R/repair_call.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
#'
88
#' `repair_call()` call can adjust the model objects call to be usable by other
99
#' functions and methods.
10-
#' @param x A fitted `parsnip` model. An error will occur if the underlying model
10+
#' @param x A fitted parsnip model. An error will occur if the underlying model
1111
#' does not have a `call` element.
1212
#' @param data A data object that is relevant to the call. In most cases, this
13-
#' is the data frame that was given to `parsnip` for the model fit (i.e., the
13+
#' is the data frame that was given to parsnip for the model fit (i.e., the
1414
#' training set data). The name of this data object is inserted into the call.
1515
#' @return A modified `parsnip` fitted model.
1616
#' @examplesIf !parsnip:::is_cran_check()
@@ -21,7 +21,7 @@
2121
#' fit(mpg ~ ., data = mtcars)
2222
#'
2323
#' # In this call, note that `data` is not `mtcars` and the `model = ~TRUE`
24-
#' # indicates that the `model` argument is an `rlang` quosure.
24+
#' # indicates that the `model` argument is an rlang quosure.
2525
#' fitted_model$fit$call
2626
#'
2727
#' # All better:

R/tidy_glmnet.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#' tidy methods for glmnet models
22
#'
33
#' `tidy()` methods for the various `glmnet` models that return the coefficients
4-
#' for the specific penalty value used by the `parsnip` model fit.
5-
#' @param x A fitted `parsnip` model that used the `glmnet` engine.
4+
#' for the specific penalty value used by the parsnip model fit.
5+
#' @param x A fitted parsnip model that used the `glmnet` engine.
66
#' @param penalty A _single_ numeric value. If none is given, the value specified
77
#' in the model specification is used.
88
#' @param ... Not used

R/tidy_liblinear.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#' tidy methods for LiblineaR models
22
#'
33
#' `tidy()` methods for the various `LiblineaR` models that return the
4-
#' coefficients from the `parsnip` model fit.
5-
#' @param x A fitted `parsnip` model that used the `LiblineaR` engine.
4+
#' coefficients from the parsnip model fit.
5+
#' @param x A fitted parsnip model that used the `LiblineaR` engine.
66
#' @param ... Not used
77
#' @return A tibble with columns `term` and `estimate`.
88
#' @keywords internal

R/translate.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#' the model fitting function/engine.
2121
#'
2222
#' This function can be useful when you need to understand how
23-
#' `parsnip` goes from a generic model specific to a model fitting
23+
#' parsnip goes from a generic model specific to a model fitting
2424
#' function.
2525
#'
2626
#' **Note**: this function is used internally and users should only use it

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,8 @@ rand_forest(mtry = 10, trees = 2000) %>%
153153
#> Target node size: 5
154154
#> Variable importance mode: impurity
155155
#> Splitrule: variance
156-
#> OOB prediction error (MSE): 5.976917
157-
#> R squared (OOB): 0.8354559
156+
#> OOB prediction error (MSE): 5.725636
157+
#> R squared (OOB): 0.8423737
158158
```
159159

160160
A list of all parsnip models across different CRAN packages can be found

issue_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Bug report or feature request
33
about: Describe a bug you've seen or make a case for a new feature
44
---
55

6-
# PLEASE READ: Making a new issue for `parsnip`
6+
# PLEASE READ: Making a new issue for parsnip
77

88

99
Please follow the template below.

man/details_logistic_reg_gee.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/extract-parsnip.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/model_spec.Rd

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

man/parsnip_addin.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/repair_call.Rd

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

man/rmd/logistic_reg_gee.html

Lines changed: 494 additions & 0 deletions
Large diffs are not rendered by default.

man/rmd/logistic_reg_gee.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Both `gee:gee()` and `gee:geepack()` specify the id/cluster variable using an ar
4747
gee(breaks ~ tension, id = wool, data = warpbreaks, corstr = "exchangeable")
4848
```
4949

50-
With `parsnip`, we suggest using the formula method when fitting:
50+
With parsnip, we suggest using the formula method when fitting:
5151

5252
```r
5353
library(tidymodels)

man/rmd/nearest-neighbor.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ nearest_neighbor() %>%
4444
```
4545

4646
For `kknn`, the underlying modeling function used is a restricted version of
47-
`train.kknn()` and not `kknn()`. It is set up in this way so that `parsnip` can
47+
`train.kknn()` and not `kknn()`. It is set up in this way so that parsnip can
4848
utilize the underlying `predict.train.kknn` method to predict on new data. This
4949
also means that a single value of that function's `kernel` argument (a.k.a
5050
`weight_func` here) can be supplied

man/set_engine.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/set_new_model.Rd

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

man/show_engines.Rd

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

man/tidy._LiblineaR.Rd

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

man/tidy._elnet.Rd

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

man/translate.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/articles/Submodels.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ theme_set(theme_bw())
1818

1919
Some R packages can create predictions from models that are different than the one that was fit. For example, if a boosted tree is fit with 10 iterations of boosting, the model can usually make predictions on _submodels_ that have less than 10 trees (all other parameters being static). This is helpful for model tuning since you can cheaply evaluate tuning parameter combinations which often results in a large speed-up in the computations.
2020

21-
In `parsnip`, there is a method called `multi_predict()` that can do this. It's current methods are:
21+
In parsnip, there is a method called `multi_predict()` that can do this. It's current methods are:
2222

2323
```{r methods}
2424
library(parsnip)

0 commit comments

Comments
 (0)