https://github.com/tidymodels/rules
parsnip extension for rule-based models
https://github.com/tidymodels/rules
Last synced: 5 months ago
JSON representation
parsnip extension for rule-based models
- Host: GitHub
- URL: https://github.com/tidymodels/rules
- Owner: tidymodels
- License: other
- Created: 2019-10-27T20:58:03.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-10-16T18:30:52.000Z (about 1 year ago)
- Last Synced: 2025-03-29T16:07:21.225Z (9 months ago)
- Language: R
- Homepage: https://rules.tidymodels.org
- Size: 6.13 MB
- Stars: 40
- Watchers: 6
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.Rmd
- Changelog: NEWS.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: .github/CODE_OF_CONDUCT.md
- Support: .github/SUPPORT.md
Awesome Lists containing this project
README
---
output: github_document
---
```{r}
#| include: false
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# rules
[](https://lifecycle.r-lib.org/articles/stages.html)
[](https://github.com/tidymodels/rules/actions/workflows/R-CMD-check.yaml)
[](https://app.codecov.io/gh/tidymodels/rules?branch=main)
[](https://cran.r-project.org/package=rules)
## Introduction
rules is a [parsnip](https://parsnip.tidymodels.org/) extension package with model definitions for rule-based models, including:
* cubist models that have discrete rule sets that contain linear models with an ensemble method similar to boosting
* classification rules where a ruleset is derived from an initial tree fit
* _rule-fit_ models that begin with rules extracted from a tree ensemble which are then added to a regularized linear or logistic regression.
## Installation
You can install the released version of rules from [CRAN](https://CRAN.R-project.org) with:
``` r
install.packages("rules")
```
Install the development version from GitHub with:
``` r
# install.packages("pak")
pak::pak("tidymodels/rules")
```
## Available Engines
The rules package provides engines for the models in the following table.
```{r}
#| echo: false
#| message: false
library(parsnip)
parsnip_models <- setNames(nm = get_from_env("models")) |>
purrr::map_dfr(get_from_env, .id = "model")
library(rules)
rules_models <- setNames(nm = get_from_env("models")) |>
purrr::map_dfr(get_from_env, .id = "model")
dplyr::anti_join(
rules_models, parsnip_models,
by = c("model", "engine", "mode")
) |>
knitr::kable()
```
## Contributing
This project is released with a [Contributor Code of Conduct](https://www.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 RStudio Community](https://community.rstudio.com/new-topic?category_id=15&tags=tidymodels,question).
- If you think you have encountered a bug, please [submit an issue](https://github.com/tidymodels/rules/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/).