Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

prepareTransactions

Helper to Convert Data into Transactions


Description

Converts a data.frame into transactions by applying class-based discretization.

Usage

prepareTransactions(formula, data, disc.method = "mdlp", match = NULL)

Arguments

formula

the formula.

data

a data.frame with the data.

disc.method

Discretization method used to discretize continuous variables if data is a data.frame (default: "mdlp"). See discretizeDF.supervised for more supervised discretization methods.

match

typically NULL. Only used internally if data is a already a set of transactions.

Value

An object of class transactions from arules with an attribute called "disc_info" that contains information on the used discretization for each column.

Author(s)

Michael Hahsler

See Also

Examples

data("iris")

iris_trans <- prepareTransactions(Species ~ ., iris)
iris_trans

arulesCBA

Classification Based on Association Rules

v1.2.0
GPL-3
Authors
Michael Hahsler [aut, cre, cph], Ian Johnson [aut, cph], Tyler Giallanza [ctb]
Initial release
2020-4-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.