regressor: Regression Based on Association Rules

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Build a regression model using a transaction boosting classification by association algorithm. The algorithm is currently in development, and is not yet formally documented.

Usage

1
2
3
4
5
bCBA.regressor(formula, data, support = 0.2,
    confidence = 0.8, gamma = 0.05, cost = 10.0,
    num_levels = 20, verbose=FALSE, parameter = NULL,
    control = NULL, sort.parameter=NULL, lhs.support=TRUE,
		disc.method="cluster", disc.categories=10)

Arguments

formula

A symbolic description of the model to be fitted. Has to be of form class ~ .. The class is the variable name (part of the item label before =).

data

A data.frame containing the training data.

support, confidence

Minimum support and confidence for creating association rules.

gamma, cost

Hyperparameters for the bCBA algorithm.

num_levels

The number of levels into which the target will be quantized for classification.

verbose

Optional logical flag to allow verbose execution, where additional intermediary execution information is printed at runtime.

parameter, control

Optional parameter and control lists for apriori.

sort.parameter

Ordered vector of arules interest measures (as characters) which are used to sort rules in preprocessing.

lhs.support

Logical variable, which, when set to default value of True, indicates that LHS support should be used for rule mining.

disc.method

Discretization method for arules discretize function for factorizing numeric input (default: "cluster")

disc.categories

Number of discretization categories for arules discretize function for factorizing numeric input (default: 10)

Details

Uses the bCBA algorithm from arulesCBA to build a transaction-boosted classifier with weighted rules for predicting the target variable. The weighted rules are used in regression by calculating the weighted sum of the means of the class values for the rules which match the new item.

Value

Returns an object of class CBA representing the trained classifier with fields:

rules

the classifier rule base.

default

deault class label.

levels

levels of the class variable.

means

the means of each discretized bucket of the target variable.

Author(s)

Ian Johnson

See Also

predict.CBA, bCBA, apriori, rules, transactions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
  library(arulesCBA)

  data(iris)
  irisDisc <- as.data.frame(lapply(iris[2:4], function(x) discretize(x, categories=9)))
  irisDisc$Sepal.Length <- iris$Sepal.Length
  irisDisc$Species <- iris$Species

  regressor <- bCBA.regression(Sepal.Length ~ ., irisDisc, support = .01)
result <- predict(regressor, irisDisc)

  #Mean squared error
  sum((result - iris$Sepal.Length)^2) / length(result)
  summary(result)
  summary(iris$Sepal.Length)

ianjjohnson/arulesRegression documentation built on May 18, 2019, 1:28 a.m.