Skip to content

Commit 2d57692

Browse files
committed
avoiding "Possibly mis-spelled words in DESCRIPTION", r-hub suggestions and doc update
1 parent ab1f399 commit 2d57692

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+867
-139
lines changed

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
Package: parsnip
22
Version: 0.0.1
33
Title: A Common API to Modeling and Analysis Functions
4-
Description: A common interface is provided to allow users to specify a model without having to remember the different argument names across different functions or computational engines (e.g. R, spark, stan, etc).
4+
Description: A common interface is provided to allow users to specify a model without having to remember the different argument names across different functions or computational engines (e.g. R, Spark, Stan, etc).
55
Authors@R: c(
66
person("Max", "Kuhn", , "max@rstudio.com", c("aut", "cre")),
7+
person("Davis", "Vaughan", , "davis@rstudio.com", c("aut")),
78
person("RStudio", role = "cph"))
89
Maintainer: Max Kuhn <max@rstudio.com>
910
URL: https://tidymodels.github.io/parsnip

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# parsnip 0.0.1
2+
3+
First CRAN release
4+
15
# parsnip 0.0.0.9005
26

37
* The engine, and any associated arguments, are now specified using `set_engine`. There is no `engine` argument

R/boost_tree.R

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ multi_predict._xgb.Booster <-
361361
function(object, new_data, type = NULL, trees = NULL, ...) {
362362
if (any(names(enquos(...)) == "newdata"))
363363
stop("Did you mean to use `new_data` instead of `newdata`?", call. = FALSE)
364-
364+
365365
if (is.null(trees))
366366
trees <- object$fit$nIter
367367
trees <- sort(trees)
@@ -409,7 +409,8 @@ xgb_by_tree <- function(tree, object, new_data, type, ...) {
409409

410410
#' Boosted trees via C5.0
411411
#'
412-
#' `C5.0_train` is a wrapper for [C50::C5.0()] tree-based models
412+
#' `C5.0_train` is a wrapper for the `C5.0()` function in the
413+
#' \pkg{C50} package that fits tree-based models
413414
#' where all of the model arguments are in the main function.
414415
#'
415416
#' @param x A data frame or matrix of predictors.
@@ -467,7 +468,7 @@ multi_predict._C5.0 <-
467468
function(object, new_data, type = NULL, trees = NULL, ...) {
468469
if (any(names(enquos(...)) == "newdata"))
469470
stop("Did you mean to use `new_data` instead of `newdata`?", call. = FALSE)
470-
471+
471472
if (is.null(trees))
472473
trees <- min(object$fit$trials)
473474
trees <- sort(trees)

README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,37 @@ rf_3 <- ml_random_forest(
3232

3333
Note that the model syntax is very different and that the argument names (and formats) are also different. This is a pain if you go between implementations.
3434

35-
In this example, the **type** of model is "random forest" while the **mode** of the model is "classification" (as opposed to regression, survival analysis, etc).
35+
In this example,
36+
37+
* the **type** of model is "random forest"
38+
* the **mode** of the model is "classification" (as opposed to regression, etc).
39+
* the computational **engine** is the name of the R package.
3640

3741

3842
The idea of `parsnip` is to:
3943

4044
* Separate the definition of a model from its evaluation.
4145
* Decouple the model specification from the implementation (whether the implementation is in R, spark, or something else). For example, the user would call `rand_forest` instead of `ranger::ranger` or other specific packages.
4246
* Harmonize the argument names (e.g. `n.trees`, `ntrees`, `trees`) so that users can remember a single name. This will help _across_ model types too so that `trees` will be the same argument across random forest as well as boosting or bagging.
47+
48+
Using the example above, the `parsnip` approach would be
49+
50+
```r
51+
rand_forest(mtry = 12, trees = 2000) %>%
52+
set_engine("ranger", importance = 'impurity') %>%
53+
fit(y ~ ., data = dat)
54+
```
55+
56+
The engine can be easily changed and the mode can be determined when `fit` is called. To use Spark, the change is simple:
57+
58+
```r
59+
rand_forest(mtry = 12, trees = 2000) %>%
60+
set_engine("spark") %>%
61+
fit(y ~ ., data = dat)
62+
```
63+
64+
65+
4366
To install it, use:
4467

4568
```r

_pkgdown.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ reference:
1818
- title: Models
1919
contents:
2020
- boost_tree
21+
- decision_tree
2122
- linear_reg
2223
- logistic_reg
2324
- mars

docs/articles/articles/Classification.html

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

0 commit comments

Comments
 (0)