Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tidymodels/usemodels
Boilerplate Code for tidymodels
https://github.com/tidymodels/usemodels
Last synced: 3 days ago
JSON representation
Boilerplate Code for tidymodels
- Host: GitHub
- URL: https://github.com/tidymodels/usemodels
- Owner: tidymodels
- License: other
- Created: 2020-06-06T00:02:59.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-10-17T15:15:46.000Z (27 days ago)
- Last Synced: 2024-10-31T22:03:17.533Z (12 days ago)
- Language: R
- Homepage: https://usemodels.tidymodels.org
- Size: 2.19 MB
- Stars: 84
- Watchers: 7
- Forks: 6
- Open Issues: 7
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Codeowners: .github/CODEOWNERS
Awesome Lists containing this project
- jimsghstars - tidymodels/usemodels - Boilerplate Code for tidymodels (R)
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "",
prompt = TRUE,
fig.path = "man/figures/README-",
out.width = "100%"
)
```# usemodels
[![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)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/).