This task refers to generate IF - THEN rules. The rule represents knowledge which is contained in a dataset.
In the package, we provide the following functions:

  •  RI.hybridFS.FRST: It is a function for generating rules based on hybrid fuzzy-rough rule induction and feature selection. It allows for classi cation and regression tasks.
  •  RI.GFRS.FRST: It is a function generating rules in classi cation tasks using the fuzzy variable precision rough sets (FVPRS) approach.
  •  RI.indiscernibilityBasedRules.RST: It is a function generating rule induction based on indiscernibility classes based on RST.

RI.hybridFS.FRST
R> ##############################################
R> ## Example: Classification Task
R> ##############################################
R> data(RoughSetData)
R> decision.table <- RoughSetData$pima7.dt
R> ## using RI.hybrid.FRST for generating rules
R> control <- list(type.aggregation = c("t.tnorm", "lukasiewicz"),
+ type.relation = c("tolerance", "eq.1"), t.implicator = "lukasiewicz")
R> rules.hybrid <- RI.hybridFS.FRST(decision.table, control)
R> print(rules.hybrid)
$rules
$rules$rules
$rules$rules[[1]]
         preg plas class
value 1      101  1
$rules$rules[[2]]
         preg plas class
value 0      100 1
$rules$rules[[3]]
         preg plas class
value 0      105 1
$rules$rules[[4]]
         preg plas class
value 1      95   1

$rules$rules[[5]]
         pres plas pedi class
value 90    176 0.467 2
$rules$rules[[6]]
         pres plas  pedi   class
value 66    150  0.718 1
$rules$rules[[7]]
         pres plas pedi   class
value 68    187 0.254  2
$type.model
[1] "FRST"
$type.method
[1] "RI.hybridFS.FRST"
$type.task
[1] "classification"
$t.similarity
[1] "eq.1"
$t.tnorm
[1] "lukasiewicz"
$variance.data
       preg        plas         pres       pedi
[1,] 3.690399 39.48357 14.11517 0.2760168
$range.data
      preg plas pres pedi
[1,] 8     92    40   0.789
$antecedent.attr
[1] "preg" "plas" "pres" "pedi"
$consequent.attr
[1] "class"
$nominal.att
[1] FALSE FALSE FALSE FALSE

attr(,"class")
[1] "RuleSetFRST" "list"


R> ## in this case, we are using the same dataset as training data
R> res.1 <- predict(rules.hybrid, decision.table[, -ncol(decision.table)])
R> print(res.1)
class
1 1
2 2
3 1
4 2
5 1
6 1
7 1

R> ##############################################
R> ## Example: Regression Task
R> ##############################################
R> data(RoughSetData)
R> decision.table <- RoughSetData$housing7.dt
R> ## using RI.hybrid.FRST for generating rules
R> control <- list(type.aggregation = c("t.tnorm", "lukasiewicz"),
+ type.relation = c("tolerance", "eq.1"), t.implicator = "lukasiewicz")
R> rules <- RI.hybridFS.FRST(decision.table, control)

R> print(rules)
$rules
$rules$rules
$rules$rules[[1]]
         CRIM MEDV
value 3.321 13.4
$rules$rules[[2]]
        RAD MEDV
value 4 48.5
$rules$rules[[3]]
         RAD MEDV
value 6     20.1
$rules$rules[[4]]
         B       MEDV
value 261.9 19.4
$rules$rules[[5]]
          CRIM RM MEDV

value 1.414 6.129 17
$rules$rules[[6]]
         ZN    RM    MEDV
value 12.5 6.012 22.9
$rules$rules[[7]]
         ZN RM     MEDV
value 45 7.185 34.9
$type.model
[1] "FRST"
$type.method
[1] "RI.hybridFS.FRST"
$type.task
[1] "regression"
$t.similarity
[1] "eq.1"
$t.tnorm
[1] "lukasiewicz"
$variance.data
       CRIM      RAD         B             RM ZN
[1,] 1.308584 34.99575 0.8652022 NA 53.51485
$range.data
       CRIM RAD B     RM ZN
[1,] 3.286 95   2.45 NA 135
$antecedent.attr
[1] "CRIM" "RAD" "B" "RM" "ZN"
$consequent.attr
[1] "MEDV"
$nominal.att
[1] FALSE FALSE FALSE TRUE FALSE
attr(,"class")
[1] "RuleSetFRST" "list"

R> ## in this case, we are using the same dataset as training data
R> res.1 <- predict(rules, decision.table[, -ncol(decision.table)])
R> print(res.1)
MEDV
1 18.74971
2 13.40000
3 19.40000
4 17.00000
5 34.90000
6 48.50000
7 20.10000
R>

 

RI.GFRS.FRST
R> ##############################################
R> ## Example: Classification Task
R> ##############################################
R> data(RoughSetData)
R> decision.table <- RoughSetData$pima7.dt
R> ## using RI.GFRS.FRST for generating rules
R> control <- list(alpha.precision = 0.01, type.aggregation = c("t.tnorm",
+ "lukasiewicz"), type.relation = c("tolerance", "eq.3"),
+ t.implicator = "lukasiewicz")
R> rules.gfrs <- RI.GFRS.FRST(decision.table, control)
R> print(rules.gfrs)
$rules
$rules$rules
$rules$rules[[1]]
         age preg plas insu class
value 22    0     105 142  1
$rules$rules[[2]]
         age pres class
value 58   90    2
$rules$rules[[3]]
         age pedi   class
value 42   0.718 1
$rules$rules[[4]]
         age pedi  class
value 41   0.254 2

$rules$threshold
[1] 1 1 1 1
$type.model
[1] "FRST"
$type.method
[1] "RI.GFRS.FRST"
$type.task
[1] "classification"
$t.similarity
[1] "eq.3"
$t.tnorm
[1] "lukasiewicz"
$variance.data
      age          preg        plas         insu        pres          pedi
[1,] 3.690399 39.48357 14.11517 131.1764 0.2760168 12.78019
$range.data
      age preg plas insu pres pedi
[1,] 8    92    40    306 0.789 36
$antecedent.attr
[1] "age" "preg" "plas" "insu" "pres" "pedi"
$consequent.attr
[1] "class"
$nominal.att
[1] FALSE FALSE FALSE FALSE FALSE FALSE
attr(,"class")
[1] "RuleSetFRST" "list"


R> ## in this case, we are using the same dataset as training data
R> res.2 <- predict(rules.gfrs, decision.table[, -ncol(decision.table)])
R> print(res.2)
class
1 1

2 2
3 1
4 2
5 1
6 1
7 1

 

RI.indiscernibilityBasedRules.RST
R> ##############################################
R> ## Example: Classification Task
R> ##############################################
R> data(RoughSetData)
R> decision.table <- RoughSetData$hiring.dt
R> #### Rule induction based on RST ####
R> ## determine feature subset/reduct
R> reduct <- FS.permutation.heuristic.reduct.RST(decision.table,
+ permutation = NULL)
R> print(reduct)
$reduct
Experience Reference
2 4
$type.method
[1] "permutation.heuristic"
$type.task
[1] "feature selection"
$model
[1] "RST"
attr(,"class")
[1] "FeatureSubset" "list"
R> ## generate rules
R> rules.rst <- RI.indiscernibilityBasedRules.RST(decision.table, reduct)
R> print(rules.rst)
$High Excellent
$High Excellent$idx
Experience Reference
2 4
$High Excellent$values
Experience Reference

3 High Excellent
$High Excellent$consequent
[1] "Accept"
$High Excellent$support
[1] 3
$High Excellent$laplace
Accept
0.6666667
$High Good
$High Good$idx
Experience Reference
2 4
$High Good$values
Experience Reference
4 High Good
$High Good$consequent
[1] "Accept"
$High Good$support
[1] 4
$High Good$laplace
Accept
0.6666667
$High Neutral
$High Neutral$idx
Experience Reference
2 4
$High Neutral$values
Experience Reference
2 High Neutral
$High Neutral$consequent
[1] "Accept"
$High Neutral$support

[1] 2
$High Neutral$laplace
Accept
0.6666667
$Low Excellent
$Low Excellent$idx
Experience Reference
2 4
$Low Excellent$values
Experience Reference
8 Low Excellent
$Low Excellent$consequent
[1] "Reject"
$Low Excellent$support
[1] 8
$Low Excellent$laplace
Reject
0.6666667
$Low Good
$Low Good$idx
Experience Reference
2 4
$Low Good$values
Experience Reference
6 Low Good
$Low Good$consequent
[1] "Reject"
$Low Good$support
[1] 6
$Low Good$laplace
Reject
0.6666667

$Low Neutral
$Low Neutral$idx
Experience Reference
2 4
$Low Neutral$values
Experience Reference
5 Low Neutral
$Low Neutral$consequent
[1] "Reject"
$Low Neutral$support
[1] 5
$Low Neutral$laplace
Reject
0.6666667
$Medium Excellent
$Medium Excellent$idx
Experience Reference
2 4
$Medium Excellent$values
Experience Reference
1 Medium Excellent
$Medium Excellent$consequent
[1] "Accept"
$Medium Excellent$support
[1] 1
$Medium Excellent$laplace
Accept
0.6666667
$Medium Neutral
$Medium Neutral$idx
Experience Reference
2 4

$Medium Neutral$values
Experience Reference
7 Medium Neutral
$Medium Neutral$consequent
[1] "Reject"
$Medium Neutral$support
[1] 7
$Medium Neutral$laplace
Reject
0.6666667
attr(,"uniqueCls")
[1] "Accept" "Reject"
attr(,"clsProbs")
Accept Reject
0.5 0.5
attr(,"majorityCls")
[1] "Accept"
attr(,"method")
[1] "indiscernibilityBasedRules"
attr(,"class")
[1] "RuleSetRST" "list"
R> ## predicting newdata
R> ## in this case, we are using the same dataset as training data
R> res.1 <- predict(rules.rst, decision.table[, -ncol(decision.table)])
R> print(res.1)
class
1 Accept
2 Accept
3 Accept
4 Accept
5 Reject
6 Reject
7 Reject
8 Reject