Skip to content

0.1.4 RC #387

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 2 commits into from
Oct 28, 2020
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
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Package: parsnip
Version: 0.1.3.9000
Version: 0.1.4
Title: A Common API to Modeling and Analysis Functions
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).
Authors@R: c(
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# parsnip (development version)
# parsnip 0.1.4

* `show_engines()` will provide information on the current set for a model.

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ rand_forest(mtry = 10, trees = 2000) %>%
fit(mpg ~ ., data = mtcars)
#> parsnip model object
#>
#> Fit time: 98ms
#> Fit time: 71ms
#> Ranger result
#>
#> Call:
#> ranger::ranger(formula = mpg ~ ., data = data, mtry = ~10, num.trees = ~2000, importance = ~"impurity", num.threads = 1, verbose = FALSE, seed = sample.int(10^5, 1))
#> ranger::ranger(x = maybe_data_frame(x), y = y, mtry = min_cols(~10, x), num.trees = ~2000, importance = ~"impurity", num.threads = 1, verbose = FALSE, seed = sample.int(10^5, 1))
#>
#> Type: Regression
#> Number of trees: 2000
Expand Down
6 changes: 3 additions & 3 deletions vignettes/parsnip_Intro.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ rf_with_seed %>%
#> Ranger result
#>
#> Call:
#> ranger::ranger(formula = formula, data = data, mtry = ~4, num.trees = ~2000, seed = sample.int(10^5, 1), num.threads = 1, verbose = FALSE)
#> ranger::ranger(x = maybe_data_frame(x), y = y, mtry = min_cols(~4, x), num.trees = ~2000, num.threads = 1, verbose = FALSE, seed = sample.int(10^5, 1))
#>
#> Type: Regression
#> Number of trees: 2000
Expand Down Expand Up @@ -138,7 +138,7 @@ rf_with_seed %>%
#>
#>
#> Call:
#> randomForest(x = as.data.frame(x), y = y, ntree = ~2000, mtry = ~4)
#> randomForest(x = maybe_data_frame(x), y = y, ntree = ~2000, mtry = min_cols(~4, x))
#> Type of random forest: regression
#> Number of trees: 2000
#> No. of variables tried at each split: 4
Expand All @@ -149,7 +149,7 @@ rf_with_seed %>%

Note that the call objects show `num.trees = ~2000`. The tilde is the consequence of `parsnip` using [quosures](https://adv-r.hadley.nz/evaluation.html#quosures) to process the model specification's arguments.

Normally, when a function is executed, the function's arguments are immediately evaluated. In the case of `parsnip`, the model specification's arguments are _not_; the [expression is captured](https://www.tidyverse.org/articles/2019/04/parsnip-internals/) along with the environment where it should be evaluated. That is what a quosure does.
Normally, when a function is executed, the function's arguments are immediately evaluated. In the case of `parsnip`, the model specification's arguments are _not_; the [expression is captured](https://www.tidyverse.org/blog/2019/04/parsnip-internals/) along with the environment where it should be evaluated. That is what a quosure does.

`parsnip` uses these expressions to make a model fit call that is evaluated. The tilde in the call above reflects that the argument was captured using a quosure.