From 813a4ba77fdc46a39f75dd9073dd91d5a8adc57e Mon Sep 17 00:00:00 2001 From: topepo Date: Sun, 1 Dec 2019 21:53:16 -0500 Subject: [PATCH] pkgdown update --- .../dev/articles/articles/Classification.html | 46 +- docs/dev/articles/articles/Models.html | 682 ++++++------------ docs/dev/articles/articles/Regression.html | 30 +- docs/dev/articles/articles/Scratch.html | 23 +- docs/dev/articles/articles/Submodels.html | 14 +- docs/dev/articles/parsnip_Intro.html | 2 +- docs/dev/index.html | 14 +- docs/dev/issue_template.html | 200 +++++ docs/dev/news/index.html | 2 +- docs/dev/pkgdown.css | 9 +- docs/dev/pkgdown.yml | 2 +- docs/dev/reference/C5.0_train.html | 5 +- docs/dev/reference/add_rowindex.html | 2 +- docs/dev/reference/boost_tree.html | 31 +- docs/dev/reference/check_empty_ellipse.html | 2 +- docs/dev/reference/check_times.html | 54 +- docs/dev/reference/control_parsnip.html | 2 +- docs/dev/reference/decision_tree.html | 22 +- docs/dev/reference/descriptors.html | 2 +- docs/dev/reference/fit.html | 12 +- docs/dev/reference/get_model_env.html | 2 +- docs/dev/reference/has_multi_predict.html | 2 +- docs/dev/reference/index.html | 4 +- docs/dev/reference/keras_mlp.html | 16 +- docs/dev/reference/lending_club.html | 38 +- docs/dev/reference/linear_reg.html | 12 +- docs/dev/reference/logistic_reg.html | 12 +- docs/dev/reference/make_classes.html | 2 +- docs/dev/reference/mars.html | 21 +- docs/dev/reference/mlp.html | 26 +- docs/dev/reference/model_fit.html | 4 +- docs/dev/reference/model_printer.html | 2 +- docs/dev/reference/model_spec.html | 8 +- docs/dev/reference/multi_predict.html | 37 +- docs/dev/reference/multinom_reg.html | 12 +- docs/dev/reference/nearest_neighbor.html | 10 +- docs/dev/reference/null_model.html | 2 +- docs/dev/reference/nullmodel.html | 2 +- docs/dev/reference/predict.model_fit.html | 5 +- docs/dev/reference/rand_forest.html | 16 +- docs/dev/reference/reexports.html | 2 +- docs/dev/reference/rpart_train.html | 13 +- docs/dev/reference/set_args.html | 2 +- docs/dev/reference/set_engine.html | 2 +- docs/dev/reference/set_new_model.html | 2 +- docs/dev/reference/show_call.html | 2 +- docs/dev/reference/surv_reg.html | 5 +- docs/dev/reference/svm_poly.html | 24 +- docs/dev/reference/svm_rbf.html | 16 +- docs/dev/reference/tidy.model_fit.html | 2 +- docs/dev/reference/translate.html | 2 +- docs/dev/reference/type_sum.model_spec.html | 2 +- docs/dev/reference/varying.html | 2 +- .../reference/varying_args.model_spec.html | 2 +- docs/dev/reference/wa_churn.html | 22 +- docs/dev/reference/xgb_train.html | 17 +- vignettes/articles/Models.Rmd | 41 +- 57 files changed, 815 insertions(+), 732 deletions(-) create mode 100644 docs/dev/issue_template.html diff --git a/docs/dev/articles/articles/Classification.html b/docs/dev/articles/articles/Classification.html index 22e2b5a86..a47487fd1 100644 --- a/docs/dev/articles/articles/Classification.html +++ b/docs/dev/articles/articles/Classification.html @@ -109,12 +109,12 @@

Classification Example

#> Registered S3 method overwritten by 'xts': #> method from #> as.zoo.xts zoo -#> ── Attaching packages ────────────────────────────────────────────────────────────────────────────────────────────────────────── tidymodels 0.0.3 ── -#> ✔ broom 0.5.2 ✔ purrr 0.3.3 -#> ✔ dials 0.0.3 ✔ recipes 0.1.7 -#> ✔ dplyr 0.8.3 ✔ rsample 0.0.5 -#> ✔ infer 0.5.0 ✔ yardstick 0.0.4 -#> ── Conflicts ───────────────────────────────────────────────────────────────────────────────────────────────────────────── tidymodels_conflicts() ── +#> ── Attaching packages ────────────────────────────────────────────────────────────────────────── tidymodels 0.0.3 ── +#> ✔ broom 0.5.2 ✔ purrr 0.3.3 +#> ✔ dials 0.0.3.9002 ✔ recipes 0.1.7.9001 +#> ✔ dplyr 0.8.3 ✔ rsample 0.0.5 +#> ✔ infer 0.5.0 ✔ yardstick 0.0.4 +#> ── Conflicts ───────────────────────────────────────────────────────────────────────────── tidymodels_conflicts() ── #> ✖ purrr::discard() masks scales::discard() #> ✖ dplyr::filter() masks stats::filter() #> ✖ dplyr::lag() masks stats::lag() @@ -153,22 +153,22 @@

Classification Example

nnet_fit #> parsnip model object #> -#> Fit in: 17.7sModel -#> ___________________________________________________________________________ -#> Layer (type) Output Shape Param # -#> =========================================================================== -#> dense (Dense) (None, 5) 115 -#> ___________________________________________________________________________ -#> dense_1 (Dense) (None, 5) 30 -#> ___________________________________________________________________________ -#> dropout (Dropout) (None, 5) 0 -#> ___________________________________________________________________________ -#> dense_2 (Dense) (None, 2) 12 -#> =========================================================================== +#> Fit in: 15sModel +#> ________________________________________________________________________________ +#> Layer (type) Output Shape Param # +#> ================================================================================ +#> dense (Dense) (None, 5) 115 +#> ________________________________________________________________________________ +#> dense_1 (Dense) (None, 5) 30 +#> ________________________________________________________________________________ +#> dropout (Dropout) (None, 5) 0 +#> ________________________________________________________________________________ +#> dense_2 (Dense) (None, 2) 12 +#> ================================================================================ #> Total params: 157 #> Trainable params: 157 #> Non-trainable params: 0 -#> ___________________________________________________________________________ +#> ________________________________________________________________________________

In parsnip, the predict function can be used:.

test_results <- 
   credit_test %>%
@@ -185,7 +185,7 @@ 

Classification Example

#> # A tibble: 1 x 3 #> .metric .estimator .estimate #> <chr> <chr> <dbl> -#> 1 roc_auc binary 0.824 +#> 1 roc_auc binary 0.823 test_results %>% accuracy(truth = Status, nnet_class) #> # A tibble: 1 x 3 #> .metric .estimator .estimate @@ -194,11 +194,11 @@

Classification Example

test_results %>% conf_mat(truth = Status, nnet_class) #> Truth #> Prediction bad good -#> bad 184 93 -#> good 129 707
+#> bad 187 96 +#> good 126 704 - - diff --git a/docs/dev/articles/articles/Regression.html b/docs/dev/articles/articles/Regression.html index 4ef1c2f14..0e7ed8509 100644 --- a/docs/dev/articles/articles/Regression.html +++ b/docs/dev/articles/articles/Regression.html @@ -112,13 +112,13 @@

Regression Example

#> Registered S3 method overwritten by 'xts': #> method from #> as.zoo.xts zoo -#> ── Attaching packages ────────────────────────────────────────────────────────────────────────────────────────────────────────── tidymodels 0.0.3 ── -#> ✔ broom 0.5.2 ✔ recipes 0.1.7 -#> ✔ dials 0.0.3 ✔ rsample 0.0.5 -#> ✔ dplyr 0.8.3 ✔ tibble 2.1.3 -#> ✔ infer 0.5.0 ✔ yardstick 0.0.4 +#> ── Attaching packages ────────────────────────────────────────────────────────────────────────── tidymodels 0.0.3 ── +#> ✔ broom 0.5.2 ✔ recipes 0.1.7.9001 +#> ✔ dials 0.0.3.9002 ✔ rsample 0.0.5 +#> ✔ dplyr 0.8.3 ✔ tibble 2.99.99.9010 +#> ✔ infer 0.5.0 ✔ yardstick 0.0.4 #> ✔ purrr 0.3.3 -#> ── Conflicts ───────────────────────────────────────────────────────────────────────────────────────────────────────────── tidymodels_conflicts() ── +#> ── Conflicts ───────────────────────────────────────────────────────────────────────────── tidymodels_conflicts() ── #> ✖ dplyr::combine() masks randomForest::combine() #> ✖ purrr::discard() masks scales::discard() #> ✖ dplyr::filter() masks stats::filter() @@ -155,7 +155,7 @@

rf_xy_fit #> parsnip model object #> -#> Fit in: 1.1sRanger result +#> Fit in: 945msRanger result #> #> Call: #> ranger::ranger(formula = formula, data = data, num.threads = 1, verbose = FALSE, seed = sample.int(10^5, 1)) @@ -216,7 +216,7 @@

) #> parsnip model object #> -#> Fit in: 3.3sRanger result +#> Fit in: 2.7sRanger result #> #> Call: #> ranger::ranger(formula = formula, data = data, mtry = ~3, num.trees = ~1000, num.threads = 1, verbose = FALSE, seed = sample.int(10^5, 1)) @@ -240,7 +240,7 @@

) #> parsnip model object #> -#> Fit in: 2.3s +#> Fit in: 1.9s #> Call: #> randomForest(x = as.data.frame(x), y = y, ntree = ~1000, mtry = ~3) #> Type of random forest: regression @@ -251,7 +251,7 @@

#> % Var explained: 59.4

Look at the formula code that was printed out, one function uses the argument name ntree and the other uses num.trees. parsnip doesn’t require you to know the specific names of the main arguments.

Now suppose that we want to modify the value of mtry based on the number of predictors in the data. Usually, the default value would be floor(sqrt(num_predictors)). To use a pure bagging model would require an mtry value equal to the total number of parameters. There may be cases where you may not know how many predictors are going to be present (perhaps due to the generation of indicator variables or a variable filter) so that might be difficult to know exactly.

-

When the model it being fit by parsnip, data descriptors are made available. These attempt to let you know what you will have available when the model is fit. When a model object is created (say using rand_forest), the values of the arguments that you give it are immediately evaluated… unless you delay them. To delay the evaluation of any argument, you can used rlang::expr to make an expression.

+

When the model it being fit by parsnip, data descriptors are made available. These attempt to let you know what you will have available when the model is fit. When a model object is created (say using rand_forest), the values of the arguments that you give it are immediately evaluated… unless you delay them. To delay the evaluation of any argument, you can used rlang::expr to make an expression.

Two relevant descriptors for what we are about to do are:

For mda::mda(), the main tuning parameter is subclasses which we will rewrite as sub_classes.

set_model_arg(
@@ -209,7 +208,7 @@ 

} # Capture the arguments in quosures - args <- list(sub_classes = rlang::enquo(sub_classes)) + args <- list(sub_classes = rlang::enquo(sub_classes)) # Save some empty slots for future parts of the specification out <- list(args = args, eng_args = NULL, @@ -270,7 +269,7 @@

  • func is the prediction function (in the same format as above). In many cases, packages have a predict method for their model’s class but this is typically not exported. In this case (and the example below), it is simple enough to make a generic call to predict with no associated package.
  • -args is a list of arguments to pass to the prediction function. These will mostly likely be wrapped in rlang::expr so that they are not evaluated when defining the method. For mda, the code would be predict(object, newdata, type = "class"). What is actually given to the function is the parsnip model fit object, which includes a sub-object called fit and this houses the mda model object. If the data need to be a matrix or data frame, you could also use newdata = quote(as.data.frame(newdata)) and so on.
  • +args is a list of arguments to pass to the prediction function. These will mostly likely be wrapped in rlang::expr so that they are not evaluated when defining the method. For mda, the code would be predict(object, newdata, type = "class"). What is actually given to the function is the parsnip model fit object, which includes a sub-object called fit and this houses the mda model object. If the data need to be a matrix or data frame, you could also use newdata = quote(as.data.frame(newdata)) and so on.

    The parsnip prediction code will expect the result to be an unnamed character string or factor. This will be coerced to a factor with the same levels as the original data.

    To add this method to the model environment, a similar set function is used:

    @@ -379,7 +378,7 @@

    mda_fit #> parsnip model object #> -#> Fit in: 25msCall: +#> Fit in: 19msCall: #> mda::mda(formula = formula, data = data, subclasses = ~2) #> #> Dimension: 4 @@ -559,7 +558,7 @@

    - diff --git a/docs/dev/issue_template.html b/docs/dev/issue_template.html new file mode 100644 index 000000000..3e7132279 --- /dev/null +++ b/docs/dev/issue_template.html @@ -0,0 +1,200 @@ + + + + + + + + +PLEASE READ: Making a new issue for parsnip • parsnip + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + +
    + +
    +
    + + + +
    +

    name: Bug report or feature request about: Describe a bug you’ve seen or make a case for a new feature —

    +
    + +

    Please follow the template below.

    +

    If the question is related at all to a specific data analysis, please include a minimal reprex (reproducible example). If you’ve never heard of a reprex before, start by reading “What is a reprex”, and follow the advice further down that page.

    +

    Tips:

    +
      +
    • Here is a good example issue: #139

    • +
    • Issues without a reprex will have a lower priority than the others.

    • +
    • We don’t want you to use confidential data; you can blind the data or simulate other data to demonstrate the issue. The functions caret::twoClassSim() or caret::SLC14_1() might be good tools to simulate data for you.

    • +
    • +

      Unless the problem is explicitly about parallel processing, please run sequentially.

      +
        +
      • Even if it about parallel processing, please make sure that it runs sequentially first.
      • +
      +
    • +
    • Please use set.seed() to ensure any randomness in your code is reproducible.

    • +
    • Please check https://stackoverflow.com/ or https://community.rstudio.com/ to see if someone has already asked the same question (see: Yihui’s Rule).

    • +
    • You might need to install these:

    • +
    +
    install.packages(c("reprex", "sessioninfo"), repos = "http://cran.r-project.org")
    +


    +

    When are ready to file the issue, please delete the parts above this line: < – ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ –>

    +
    +

    +The problem

    +

    I’m having trouble with … or

    +

    Have you considered …

    +
    +
    +

    +Reproducible example

    +

    Copy your code to the clipboard and run:

    +
    reprex::reprex(si = TRUE)
    +
    +
    + + +
    + +
    + + + +
    +
    +

    parsnip is a part of the tidymodels ecosystem, a collection of modeling packages designed with common APIs and a shared philosophy.

    +
    + +
    +

    + Developed by Max Kuhn, Davis Vaughan. + Site built by pkgdown. +

    +
    + +
    +
    + + + + + + + + diff --git a/docs/dev/news/index.html b/docs/dev/news/index.html index d4d6f7c95..fa7e3b3d9 100644 --- a/docs/dev/news/index.html +++ b/docs/dev/news/index.html @@ -295,7 +295,7 @@

    -