-
Notifications
You must be signed in to change notification settings - Fork 6
/
README.Rmd
69 lines (45 loc) · 2.74 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "",
prompt = TRUE,
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# usemodels
<!-- badges: start -->
[![R-CMD-check](https://github.com/tidymodels/usemodels/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidymodels/usemodels/actions/workflows/R-CMD-check.yaml)
[![Coverage status](https://codecov.io/gh/tidymodels/usemodels/branch/main/graph/badge.svg)](https://app.codecov.io/github/tidymodels/usemodels?branch=main)
[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://lifecycle.r-lib.org/articles/stages.html)
<!-- badges: end -->
The usemodels package is a helpful way of quickly creating code snippets to fit models using the tidymodels framework.
Given a simple formula and a data set, the `use_*` functions can create code that appropriate for the data (given the model).
For example, using the palmerpenguins data with a `glmnet` model:
```{r glmnet, message=FALSE}
library(usemodels)
library(palmerpenguins)
data(penguins)
use_glmnet(body_mass_g ~ ., data = penguins)
```
The recipe steps that are used (if any) depend on the type of data as well as the model. In this case, the first two steps handle the fact that `Species` is a factor-encoded predictor (and `glmnet` requires all numeric predictors). The last two steps are added because, for this model, the predictors should be on the same scale to be properly regularized.
The package includes these templates:
```{r use-list}
ls("package:usemodels", pattern = "use_")
```
You can also copy code to the clipboard using the option `clipboard = TRUE`.
## Installation
You can install usemodels with:
``` r
devtools::install_github("tidymodels/usemodels")
```
## Contributing
This project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/1/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.
- For questions and discussions about tidymodels packages, modeling, and machine learning, please [post on Posit Community](https://forum.posit.co/new-topic?category_id=15&tags=tidymodels,question).
- If you think you have encountered a bug, please [submit an issue](https://github.com/tidymodels/usemodels/issues).
- Either way, learn how to create and share a [reprex](https://reprex.tidyverse.org/articles/articles/learn-reprex.html) (a minimal, reproducible example), to clearly communicate about your code.
- Check out further details on [contributing guidelines for tidymodels packages](https://www.tidymodels.org/contribute/) and [how to get help](https://www.tidymodels.org/help/).