RI.AQRules.RST: Rule induction using the AQ algorithm

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

View source: R/RuleInduction.R

Description

A version of the AQ algorithm which was originally proposed by R.S. Michalski. This implamentation is based on a concept of a local (object-relative) decision reduct from RST.

Usage

1
RI.AQRules.RST(decision.table, confidence = 1, timesCovered = 1)

Arguments

decision.table

an object inheriting from the "DecisionTable" class, which represents a decision system. See SF.asDecisionTable.

confidence

a numeric value giving the minimal confidence of computed rules.

timesCovered

a positive integer. The algorithm will try to find a coverage of training examples with rules, such that each example is covered by at least timesCovered rules and no rule can be removed from the coverage without breaking this property. This is not always possible - there is a chance that some rules are duplicated if the value of timesCovered is larger than 1.

Value

An object of a class "RuleSetRST". For details see RI.indiscernibilityBasedRules.RST.

Author(s)

Andrzej Janusz

References

R.S. Michalski, K. Kaufman, J. Wnek: "The AQ Family of Learning Programs: A Review of Recent Developments and an Exemplary Application", Reports of Machine Learning and Inference Laboratory, George Mason University (1991)

See Also

predict.RuleSetFRST, RI.indiscernibilityBasedRules.RST, RI.CN2Rules.RST, RI.LEM2Rules.RST.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
###########################################################
## Example
##############################################################
data(RoughSetData)
wine.data <- RoughSetData$wine.dt
set.seed(13)
wine.data <- wine.data[sample(nrow(wine.data)),]

## Split the data into a training set and a test set,
## 60% for training and 40% for testing:
idx <- round(0.6 * nrow(wine.data))
wine.tra <-SF.asDecisionTable(wine.data[1:idx,],
                              decision.attr = 14,
                              indx.nominal = 14)
wine.tst <- SF.asDecisionTable(wine.data[(idx+1):nrow(wine.data), -ncol(wine.data)])

true.classes <- wine.data[(idx+1):nrow(wine.data), ncol(wine.data)]

## discretization:
cut.values <- D.discretization.RST(wine.tra,
                                   type.method = "unsupervised.quantiles",
                                   nOfIntervals = 3)
data.tra <- SF.applyDecTable(wine.tra, cut.values)
data.tst <- SF.applyDecTable(wine.tst, cut.values)

## rule induction from the training set:
rules <- RI.AQRules.RST(data.tra, confidence = 0.9, timesCovered = 3)
rules

## predicitons for the test set:
pred.vals <- predict(rules, data.tst)

## checking the accuracy of predictions:
mean(pred.vals == true.classes)

Example output

Loading required package: Rcpp
A set consisting of  36  rules:
1. IF hue is [-Inf,0.907] and magnesium is (102, Inf] and proline is (537,837] THEN  is 3;
		(supportSize=4; laplace=0.714285714285714) 
2. IF od is [-Inf,2.47] and ash is (2.26,2.46] and alcohol is (12.5,13.5] and alcalinity_of_ash is (18.2,20.8] THEN  is 3;
		(supportSize=3; laplace=0.666666666666667) 
3. IF malid_acid is (2.42, Inf] and od is [-Inf,2.47] THEN  is 3;
		(supportSize=20; laplace=0.91304347826087) 
4. IF malid_acid is (2.42, Inf] and od is [-Inf,2.47] THEN  is 3;
		(supportSize=20; laplace=0.91304347826087) 
5. IF color_intensity is (5.35, Inf] and hue is [-Inf,0.907] THEN  is 3;
		(supportSize=18; laplace=0.857142857142857) 
6. IF proanthocyanins is [-Inf,1.36] and alcohol is (13.5, Inf] and malid_acid is (2.42, Inf] THEN  is 3;
		(supportSize=6; laplace=0.777777777777778) 
7. IF flavanoids is [-Inf,1.59] and magnesium is (91,102] THEN  is 3;
		(supportSize=12; laplace=0.8) 
8. IF proline is (537,837] and total_phenols is [-Inf,1.96] and od is [-Inf,2.47] THEN  is 3;
		(supportSize=13; laplace=0.8125) 
9. IF proline is (537,837] and nonflavanoid_phenols is [-Inf,0.283] and proanthocyanins is [-Inf,1.36] THEN  is 3;
		(supportSize=3; laplace=0.666666666666667) 
10. IF total_phenols is (1.96,2.56] and nonflavanoid_phenols is (0.4, Inf] and ash is [-Inf,2.26] THEN  is 3;
		(supportSize=1; laplace=0.5) 
... and 26 other rules.
[1] 0.9577465

RoughSets documentation built on May 29, 2017, 7:06 p.m.