View source: R/RuleInduction.R
RI.AQRules.RST | R Documentation |
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.
RI.AQRules.RST(decision.table, confidence = 1, timesCovered = 1)
decision.table |
an object inheriting from the |
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 |
An object of a class "RuleSetRST"
. For details see RI.indiscernibilityBasedRules.RST
.
Andrzej Janusz
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)
predict.RuleSetFRST
, RI.indiscernibilityBasedRules.RST
, RI.CN2Rules.RST
,
RI.LEM2Rules.RST
.
###########################################################
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.