
<!-- README.md is generated from README.Rmd. Please edit that file -->

# rules <a href="https://rules.tidymodels.org/"><img src="man/figures/logo.png" align="right" height="138" alt="rules website" /></a>

<!-- badges: start -->

[![Lifecycle:
experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://lifecycle.r-lib.org/articles/stages.html)
[![R-CMD-check](https://github.com/tidymodels/rules/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tidymodels/rules/actions/workflows/R-CMD-check.yaml)
[![Codecov test
coverage](https://codecov.io/gh/tidymodels/rules/branch/main/graph/badge.svg)](https://app.codecov.io/gh/tidymodels/rules?branch=main)
[![CRAN
status](https://www.r-pkg.org/badges/version/rules)](https://cran.r-project.org/package=rules)
<!-- badges: end -->

## 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.

| model        | engine | mode           |
|:-------------|:-------|:---------------|
| C5_rules     | C5.0   | classification |
| cubist_rules | Cubist | regression     |
| rule_fit     | xrf    | classification |
| rule_fit     | xrf    | regression     |

## 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 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/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/).
