Skip to content

Commit

Permalink
kable
Browse files Browse the repository at this point in the history
  • Loading branch information
zachmayer committed Aug 13, 2024
1 parent 4461510 commit bc4571a
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 12 deletions.
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ print(summary(models))
#> The following models were ensembled: rf, glmnet
#>
#> Model accuracy:
#> model_name metric value sd
#> <char> <char> <num> <num>
#> 1: rf RMSE 1007.595 192.05082
#> 2: glmnet RMSE 1217.374 69.54145
#> model_name metric value sd
#> <char> <char> <num> <num>
#> 1: rf RMSE 1065.605 145.4863
#> 2: glmnet RMSE 1206.800 175.7538
```

Then, use caretEnsemble to make a greedy ensemble of these models
Expand All @@ -68,17 +68,17 @@ print(greedy_stack)
#> Resampling results:
#>
#> RMSE Rsquared MAE
#> 951.4063 0.947765 545.1398
#> 1043.649 0.92586 543.4189
#>
#> Tuning parameter 'max_iter' was held constant at a value of 100
#>
#> Final model:
#> Greedy MSE
#> RMSE: 959.2989
#> RMSE: 1044.709
#> Weights:
#> [,1]
#> rf 0.68
#> glmnet 0.32
#> rf 0.72
#> glmnet 0.28
ggplot2::autoplot(greedy_stack, training_data = dat, xvars = c("carat", "table"))
```

Expand All @@ -100,8 +100,8 @@ print(rf_stack)
#> Summary of sample sizes: 400, 400, 400, 400, 400
#> Resampling results:
#>
#> RMSE Rsquared MAE
#> 1030.494 0.9376481 541.5582
#> RMSE Rsquared MAE
#> 1049.47 0.9219408 522.2029
#>
#> Tuning parameter 'mtry' was held constant at a value of 2
#>
Expand All @@ -113,8 +113,8 @@ print(rf_stack)
#> Number of trees: 500
#> No. of variables tried at each split: 2
#>
#> Mean of squared residuals: 985743.6
#> % Var explained: 93.99
#> Mean of squared residuals: 1188152
#> % Var explained: 91.49
ggplot2::autoplot(rf_stack, training_data = dat, xvars = c("carat", "table"))
```

Expand Down
6 changes: 6 additions & 0 deletions README.rmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ knitr::opts_chunk$set(
fig.path = "man/figures/README-",
out.width = "100%"
)
knitr::opts_chunk$set(render = function(x, options) {
if (is.data.frame(x) || is.matrix(x)) {
return(knitr::kable(x))
}
knitr::knit_print(x)
})
```

# caretEnsemble
Expand Down
Binary file modified man/figures/README-unnamed-chunk-3-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified man/figures/README-unnamed-chunk-4-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions vignettes/Version-4.0-New-Features.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ knitr::opts_chunk$set(
warning = FALSE,
message = FALSE
)
knitr::opts_chunk$set(render = function(x, options) {
if (is.data.frame(x) || is.matrix(x)) {
return(knitr::kable(x))
}
knitr::knit_print(x)
})
set.seed(42L)
```

Expand Down
6 changes: 6 additions & 0 deletions vignettes/caretEnsemble-intro.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ knitr::opts_chunk$set(
warning = FALSE,
message = FALSE
)
knitr::opts_chunk$set(render = function(x, options) {
if (is.data.frame(x) || is.matrix(x)) {
return(knitr::kable(x))
}
knitr::knit_print(x)
})
```

`caretEnsemble` is a package for making ensembles of caret models. You should already be somewhat familiar with the caret package before trying out `caretEnsemble`.
Expand Down

0 comments on commit bc4571a

Please sign in to comment.