Skip to content

Commit

Permalink
engine-specific section headings to reduce direct repetition in table…
Browse files Browse the repository at this point in the history
… of contents
  • Loading branch information
hfrick committed Sep 22, 2021
1 parent f506583 commit b4ba5ad
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 6 deletions.
74 changes: 74 additions & 0 deletions vignettes/articles/Examples.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ The following examples use consistent data sets throughout. For regression, we u
<details id="boost-tree-xgboost">

<summary>With the `"xgboost"` engine</summary>

<h3>Regression Example (`xgboost`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-reg-chicago.R")
Expand Down Expand Up @@ -60,6 +62,8 @@ The following examples use consistent data sets throughout. For regression, we u
```


<h3>Classification Example (`xgboost`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
```
Expand Down Expand Up @@ -99,6 +103,8 @@ The following examples use consistent data sets throughout. For regression, we u

<summary>With the `"C5.0"` engine</summary>

<h3>Classification Example (`C5.0`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
```
Expand Down Expand Up @@ -138,6 +144,8 @@ The following examples use consistent data sets throughout. For regression, we u
<details id="decision-tree-rpart">

<summary>With the `"rpart"` engine</summary>

<h3>Regression Example (`rpart`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-reg-chicago.R")
Expand Down Expand Up @@ -169,6 +177,8 @@ The following examples use consistent data sets throughout. For regression, we u
```


<h3>Classification Example (`rpart`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
```
Expand Down Expand Up @@ -207,6 +217,8 @@ The following examples use consistent data sets throughout. For regression, we u
<details id="decision-tree-C5.0">

<summary>With the `"C5.0"` engine</summary>

<h3>Classification Example (`C5.0`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
Expand Down Expand Up @@ -246,6 +258,8 @@ The following examples use consistent data sets throughout. For regression, we u
<details id="linear-reg-lm">

<summary>With the `"lm"` engine</summary>

<h3>Regression Example (`lm`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-reg-chicago.R")
Expand Down Expand Up @@ -281,6 +295,8 @@ The following examples use consistent data sets throughout. For regression, we u

<summary>With the `"glmnet"` engine</summary>

<h3>Regression Example (`glmnet`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-reg-chicago.R")
```
Expand Down Expand Up @@ -314,6 +330,8 @@ The following examples use consistent data sets throughout. For regression, we u
<details id="linear-reg-keras">

<summary>With the `"keras"` engine</summary>

<h3>Regression Example (`keras`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-reg-chicago.R")
Expand Down Expand Up @@ -348,6 +366,8 @@ The following examples use consistent data sets throughout. For regression, we u
<details id="linear-reg-stan">

<summary>With the `"stan"` engine</summary>

<h3>Regression Example (`stan`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-reg-chicago.R")
Expand Down Expand Up @@ -384,6 +404,8 @@ The following examples use consistent data sets throughout. For regression, we u
<details id="logistic-reg-glm">

<summary>With the `"glm"` engine</summary>

<h3>Classification Example (`glm`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
Expand Down Expand Up @@ -422,6 +444,8 @@ The following examples use consistent data sets throughout. For regression, we u

<summary>With the `"glmnet"` engine</summary>

<h3>Classification Example (`glmnet`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
```
Expand Down Expand Up @@ -459,6 +483,8 @@ The following examples use consistent data sets throughout. For regression, we u

<summary>With the `"keras"` engine</summary>

<h3>Classification Example (`keras`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
```
Expand Down Expand Up @@ -496,6 +522,8 @@ The following examples use consistent data sets throughout. For regression, we u

<summary>With the `"LiblineaR"` engine</summary>

<h3>Classification Example (`LiblineaR`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
```
Expand Down Expand Up @@ -532,6 +560,8 @@ The following examples use consistent data sets throughout. For regression, we u
<details id="logistic-reg-stan">

<summary>With the `"stan"` engine</summary>

<h3>Classification Example (`stan`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
Expand Down Expand Up @@ -571,6 +601,8 @@ The following examples use consistent data sets throughout. For regression, we u

<summary>With the `"earth"` engine</summary>

<h3>Regression Example (`earth`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-reg-chicago.R")
```
Expand Down Expand Up @@ -600,6 +632,7 @@ The following examples use consistent data sets throughout. For regression, we u
predict(mars_reg_fit, Chicago_test)
```

<h3>Classification Example (`earth`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
Expand Down Expand Up @@ -642,6 +675,8 @@ The following examples use consistent data sets throughout. For regression, we u

<summary>With the `"nnet"` engine</summary>

<h3>Regression Example (`nnet`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-reg-chicago.R")
```
Expand Down Expand Up @@ -671,6 +706,7 @@ The following examples use consistent data sets throughout. For regression, we u
predict(mlp_reg_fit, Chicago_test)
```

<h3>Classification Example (`nnet`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
Expand Down Expand Up @@ -710,6 +746,8 @@ The following examples use consistent data sets throughout. For regression, we u

<summary>With the `"keras"` engine</summary>

<h3>Regression Example (`keras`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-reg-chicago.R")
```
Expand Down Expand Up @@ -740,6 +778,8 @@ The following examples use consistent data sets throughout. For regression, we u
```


<h3>Classification Example (`keras`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
```
Expand Down Expand Up @@ -781,6 +821,8 @@ The following examples use consistent data sets throughout. For regression, we u

<summary>With the `"glmnet"` engine</summary>

<h3>Classification Example (`glmnet`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-multi-class.R")
```
Expand Down Expand Up @@ -818,6 +860,8 @@ The following examples use consistent data sets throughout. For regression, we u

<summary>With the `"keras"` engine</summary>

<h3>Classification Example (`keras`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-multi-class.R")
```
Expand Down Expand Up @@ -855,6 +899,8 @@ The following examples use consistent data sets throughout. For regression, we u

<summary>With the `"nnet"` engine</summary>

<h3>Classification Example (`nnet`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-multi-class.R")
```
Expand Down Expand Up @@ -894,6 +940,8 @@ The following examples use consistent data sets throughout. For regression, we u

<summary>With the `"kknn"` engine</summary>

<h3>Regression Example (`kknn`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-reg-chicago.R")
```
Expand Down Expand Up @@ -923,6 +971,8 @@ The following examples use consistent data sets throughout. For regression, we u
```


<h3>Classification Example (`kknn`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
```
Expand Down Expand Up @@ -963,6 +1013,8 @@ The following examples use consistent data sets throughout. For regression, we u

<summary>With the `"ranger"` engine</summary>

<h3>Regression Example (`ranger`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-reg-chicago.R")
```
Expand Down Expand Up @@ -993,6 +1045,8 @@ The following examples use consistent data sets throughout. For regression, we u
```


<h3>Classification Example (`ranger`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
```
Expand Down Expand Up @@ -1032,6 +1086,8 @@ The following examples use consistent data sets throughout. For regression, we u

<summary>With the `"randomForest"` engine</summary>

<h3>Regression Example (`randomForest`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-reg-chicago.R")
```
Expand Down Expand Up @@ -1062,6 +1118,8 @@ The following examples use consistent data sets throughout. For regression, we u
```


<h3>Classification Example (`randomForest`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
```
Expand Down Expand Up @@ -1103,6 +1161,8 @@ The following examples use consistent data sets throughout. For regression, we u

<summary>With the `"LiblineaR"` engine</summary>

<h3>Regression Example (`LiblineaR`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-reg-chicago.R")
```
Expand Down Expand Up @@ -1133,6 +1193,8 @@ The following examples use consistent data sets throughout. For regression, we u
```


<h3>Classification Example (`LiblineaR`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
```
Expand Down Expand Up @@ -1169,6 +1231,8 @@ The following examples use consistent data sets throughout. For regression, we u

<summary>With the `"kernlab"` engine</summary>

<h3>Regression Example (`kernlab`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-reg-chicago.R")
```
Expand Down Expand Up @@ -1199,6 +1263,8 @@ The following examples use consistent data sets throughout. For regression, we u
```


<h3>Classification Example (`kernlab`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
```
Expand Down Expand Up @@ -1240,6 +1306,8 @@ The following examples use consistent data sets throughout. For regression, we u

<summary>With the `"kernlab"` engine</summary>

<h3>Regression Example (`kernlab`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-reg-chicago.R")
```
Expand Down Expand Up @@ -1270,6 +1338,8 @@ The following examples use consistent data sets throughout. For regression, we u
```


<h3>Classification Example (`kernlab`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
```
Expand Down Expand Up @@ -1311,6 +1381,8 @@ The following examples use consistent data sets throughout. For regression, we u

<summary>With the `"kernlab"` engine</summary>

<h3>Regression Example (`kernlab`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-reg-chicago.R")
```
Expand Down Expand Up @@ -1341,6 +1413,8 @@ The following examples use consistent data sets throughout. For regression, we u
```


<h3>Classification Example (`kernlab`)</h3>

```{r echo=FALSE}
knitr::spin_child("template-cls-two-class.R")
```
Expand Down
2 changes: 0 additions & 2 deletions vignettes/articles/template-cls-multi-class.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#' <h3>Classification Example</h3>

#' We'll predict the island where the penguins were observed with two variables in the same unit (mm): bill length and bill depth.

#+ results = "hide", messages = FALSE
Expand Down
2 changes: 0 additions & 2 deletions vignettes/articles/template-cls-two-class.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#' <h3>Classification Example</h3>

#' The example data has two predictors and an outcome with two classes. Both predictors are in the same units

#+ results = "hide", messages = FALSE
Expand Down
2 changes: 0 additions & 2 deletions vignettes/articles/template-reg-chicago.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#' <h3>Regression Example</h3>

#' We'll model the ridership on the Chicago elevated trains as a function of the 14 day lagged ridership at two stations. The two predictors are in the same units (rides per day/1000) and do not need to be normalized.

#' All but the last week of data are used for training. The last week will be predicted after the model is fit.
Expand Down

0 comments on commit b4ba5ad

Please sign in to comment.