as_rulelist.data.frame: as_rulelist method for a data.frame

View source: R/rulelist.R

as_rulelist.data.frameR Documentation

as_rulelist method for a data.frame

Description

Convert a set of rules in a dataframe to a rulelist

Usage

## S3 method for class 'data.frame'
as_rulelist(x, keys = NULL, model_type = NULL, estimation_type, ...)

Arguments

x

dataframe to be coerced to a rulelist

keys

(character vector, default: NULL) column names which form the key

model_type

(string, default: NULL) Name of the model which generated the rules

estimation_type

(string) One among: 'regression', 'classification'

...

currently unused

Details

Input dataframe should contain these columns: rule_nbr, LHS, RHS. Providing other inputs helps augment better.

Value

rulelist object

See Also

rulelist, tidy, augment, predict, calculate, prune, reorder

Examples

rules_df = tidytable::tidytable(rule_nbr = 1:2,
                                LHS      = c("var_1 > 50", "var_2 < 30"),
                                RHS      = c(2, 1)
                                )
as_rulelist(rules_df, estimation_type = "regression")

tidyrules documentation built on June 30, 2024, 1:07 a.m.