# RI.LEM2Rules.RST: Rule induction using the LEM2 algorithm In RoughSets: Data Analysis Using Rough Set and Fuzzy Rough Set Theories

## Description

An implementation of LEM2 (Learning from Examples Module, version 2) for induction of decision rules, originally proposed by J.W. Grzymala-Busse.

## Usage

 `1` ```RI.LEM2Rules.RST(decision.table) ```

## Arguments

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

## Value

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

Andrzej Janusz

## References

J.W. Grzymala-Busse, "A New Version of the Rule Induction System LERS", Fundamenta Informaticae, 31, p. 27 - 39 (1997).

`predict.RuleSetFRST`, `RI.indiscernibilityBasedRules.RST`, `RI.CN2Rules.RST`, `RI.AQRules.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 = "local.discernibility", maxNOfCuts = 1) data.tra <- SF.applyDecTable(wine.tra, cut.values) data.tst <- SF.applyDecTable(wine.tst, cut.values) ## rule induction from the training set: rules <- RI.LEM2Rules.RST(data.tra) 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  7  rules:
1. IF od is [-Inf,2.68] and hue is [-Inf,0.94] and color_intensity is (3.92, Inf] THEN  is 3;
(supportSize=24; laplace=0.925925925925926)
2. IF alcohol is [-Inf,12.7] and proline is (719, Inf] and magnesium is [-Inf,99.5] THEN  is 3;
(supportSize=1; laplace=0.5)
3. IF proline is (719, Inf] and flavanoids is (2.31, Inf] THEN  is 1;
(supportSize=36; laplace=0.948717948717949)
4. IF proline is [-Inf,719] and color_intensity is [-Inf,3.92] THEN  is 2;
(supportSize=39; laplace=0.952380952380952)
5. IF alcohol is [-Inf,12.7] and nonflavanoid_phenols is [-Inf,0.33] THEN  is 2;
(supportSize=17; laplace=0.9)
6. IF malid_acid is [-Inf,2.04] and nonflavanoid_phenols is (0.33, Inf] and color_intensity is [-Inf,3.92] THEN  is 2;
(supportSize=15; laplace=0.888888888888889)
7. IF alcohol is [-Inf,12.7] and flavanoids is (2.31, Inf] THEN  is 2;
(supportSize=8; laplace=0.818181818181818)
[1] 0.9295775
```

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