Discretization is used to convert continuous attributes into nominal ones in an information system. It is very important to perform this process since any methods based on rough set theory need nominal attributes to compute the indiscernibility relation or perform other functions. Furthermore, in order to avoid loss of information, in rough set theory point of view, the discernibility relation among objects is maintained.


There are six functions which can be used for converting to nominal values as follows:

  1. D.discretization.RST: a wrapper function of discretization.
  2. D.local.discernibility.matrix.RST: This is a function that implements the local strategy algorithm based on rough set theory for discretization tasks.
  3. D.max.discernibility.matrix.RST: This is a function that implements the maximal discernibility algorithm based on rough set theory.
  4. D.discretize.quantiles.RST: It is a function used for computing cuts of the "quantile-based" discretization into k intervals.
  5. D.discretize.equal.intervals.RST: It is a function used for computing cuts of the "equal interval size" discretization into k intervals.
  6. D.global.discernibility.heuristic.RST: It is a function used for computing globally semi-optimal cuts using the maximum discernibility heuristic.

Outputs of the above functions are cut values. So, to construct a new decision table we need to execute the SF.applyDecTable function.

  • D.discretization.RST

R> dt.ex1 <- data.frame(c(1, 2, 3, 3, 4, 5, 6, 7, 7, 8), c(2,5, 7, 6, 6, 6, 1, 8, 1, 1),
+ c(3, 5, 1, 1, 3, 6, 8, 8, 1, 1), c(0, 1, 2, 1, 0, 1, 2, 2, 0, 0))
R> colnames(dt.ex1) <- c("a1", "a2", "a3", "d")
R> decision.table <- SF.asDecisionTable(dataset = dt.ex1, decision.attr = 4, indx.nominal = c(4))
R> cut.values <- D.discretization.RST(decision.table,
+ type.method = "global.discernibility")
R> new.decTable <- SF.applyDecTable(decision.table, cut.values)

To display the cut values is by
R> print(cut.values)
$cut.values
$cut.values$a1
[1] 3.5
$cut.values$a2
[1] 3.5 6.5
$cut.values$a3
[1] 4
$type.method
[1] "global.discernibility"
$type.task
[1] "discretization"
$model
[1] "RST"
attr(,"class")
[1] "Discretization" "list"

 

  • D.local.discernibility.matrix.RST

R> dt.ex1 <- data.frame(c(1, 2, 3, 3, 4, 5, 6, 7, 7, 8), c(2,5, 7, 6, 6, 6, 1, 8, 1, 1),
+ c(3, 5, 1, 1, 3, 6, 8, 8, 1, 1), c(0, 1, 2, 1, 0, 1, 2, 2, 0, 0))
R> colnames(dt.ex1) <- c("a1", "a2", "a3", "d")
R> decision.table <- SF.asDecisionTable(dataset = dt.ex1, decision.attr = 4,
+ indx.nominal = c(4))
R> cut.values <- D.local.discernibility.matrix.RST(decision.table)
R> new.decTable <- SF.applyDecTable(decision.table, cut.values)

To display the cut values is by
R> print(cut.values)
$cut.values
$cut.values$a3

[1] 4
$cut.values$a1
[1] 3.5 5.5
$cut.values$a2
[1] 3.5 6.5
$type.method
[1] "local.strategy"
$type.task
[1] "discretization"
$model
[1] "RST"
attr(,"class")
[1] "Discretization" "list"

 

  • D.max.discernibility.matrix.RST

R> dt.ex1 <- data.frame(c(1, 1.2, 1.3, 1.4, 1.4, 1.6, 1.3), c(2, 0.5, 3, 1, 2, 3, 1),
+ c(1, 0, 0, 1, 0, 1, 1))
R> colnames(dt.ex1) <- c("a", "b", "d")
R> decision.table <- SF.asDecisionTable(dataset = dt.ex1, decision.attr = 3,
+ indx.nominal = c(3))
R> cut.values <- D.max.discernibility.matrix.RST(decision.table)
R> new.decTable <- SF.applyDecTable(decision.table, cut.values)

To display the cut values is by
R> print(cut.values)
$cut.values
$cut.values$a
[1] 1.35 1.25
$cut.values$b
[1] 0.75
$type.method
[1] "max.discernibility"
$type.task

[1] "discretization"
$model
[1] "RST"
attr(,"class")
[1] "Discretization" "list"

 

  • D.discretize.quantiles.RST

R> dt.ex1 <- data.frame(c(1, 1.2, 1.3, 1.4, 1.4, 1.6, 1.3), c(2, 0.5, 3, 1, 2, 3, 1),
+ c(1, 0, 0, 1, 0, 1, 1))
R> colnames(dt.ex1) <- c("a", "b", "d")
R> decision.table <- SF.asDecisionTable(dataset = dt.ex1, decision.attr = 3,
+ indx.nominal = c(3))
R> cut.values <- D.discretize.quantiles.RST(decision.table,
+ nOfIntervals = 4)
R> new.decTable <- SF.applyDecTable(decision.table, cut.values)

To display the cut values is by
R> print(cut.values)
$cut.values
$cut.values$a
[1] 1.25 1.30 1.40
$cut.values$b
[1] 2.0 0.5 3.0 1.0
$type.method
[1] "unsupervised.quantiles"
$type.task
[1] "discretization"
$model
[1] "RST"
attr(,"class")
[1] "Discretization" "list"

 

  • D.discretize.equal.intervals.RST

R> dt.ex1 <- data.frame(c(1, 1.2, 1.3, 1.4, 1.4, 1.6, 1.3), c(2, 0.5, 3, 1, 2, 3, 1),
+ c(1, 0, 0, 1, 0, 1, 1))

R> colnames(dt.ex1) <- c("a", "b", "d")
R> decision.table <- SF.asDecisionTable(dataset = dt.ex1, decision.attr = 3,
+ indx.nominal = c(3))
R> cut.values <- D.discretize.equal.intervals.RST(decision.table,
+ nOfIntervals = 4)
R> new.decTable <- SF.applyDecTable(decision.table, cut.values)

To display the cut values is by
R> print(cut.values)
$cut.values
$cut.values$a
[1] 1.15 1.30 1.45
$cut.values$b
[1] 1.125 1.750 2.375
$type.method
[1] "unsupervised.intervals"
$type.task
[1] "discretization"
$model
[1] "RST"
attr(,"class")
[1] "Discretization" "list"

 

  • D.global.discernibility.heuristic.RST

R> dt.ex1 <- data.frame(c(1, 1.2, 1.3, 1.4, 1.4, 1.6, 1.3), c(2, 0.5, 3, 1, 2, 3, 1),
+ c(1, 0, 0, 1, 0, 1, 1))
R> colnames(dt.ex1) <- c("a", "b", "d")
R> decision.table <- SF.asDecisionTable(dataset = dt.ex1,
+ decision.attr = 3, indx.nominal = c(3))
R> cut.values <- D.global.discernibility.heuristic.RST(decision.table)
R> new.decTable <- SF.applyDecTable(decision.table, cut.values)

To display the cut values is by
R> print(cut.values)
$cut.values
$cut.values$a
[1] 1.3 1.5

$cut.values$b
[1] 2
$type.method
[1] "global.discernibility"
$type.task
[1] "discretization"
$model
[1] "RST"
attr(,"class")
[1] "Discretization" "list"