In this example, we are using the hiring.dt data set. It has been included in the RoughSets package. In order to load the data, we need to type the following command:

R> data(RoughSetData)

R> hiring.dt <- RoughSetData$hiring.dt

- The Indiscernibility Relation

Firstly, we calculate the indiscernibility relation. For example, by considering the second and third attributes only, we obtain indiscernibility relation IND with command:

R> IND <- BC.IND.relation.RST(hiring.dt, attribute = c(2,3))

The IND object contains the equivalence classes of the objects.

R> print(IND)

$IND.relation

$IND.relation$High No

[1] 4

$IND.relation$High Yes

[1] 2 3

$IND.relation$Low No

[1] 8

$IND.relation$Low Yes

[1] 5 6

$IND.relation$Medium Yes

[1] 1 7

$type.relation

[1] "equivalence"

$type.model

[1] "RST"

attr(,"class")

[1] "IndiscernibilityRelation" "list"

- The Lower and Upper Approximations

After obtaining the relation, we can calculate the approximations (namely rough-set) and positive region (namely region) as follows.

R> roughset <- BC.LU.approximation.RST(hiring.dt, IND)

R> print(roughset)

$lower.approximation

$lower.approximation$Accept

High No High Yes1 High Yes2

4 2 3

$lower.approximation$Reject

Low No Low Yes1 Low Yes2

8 5 6

$upper.approximation

$upper.approximation$Accept

High No High Yes1 High Yes2 Medium Yes1 Medium Yes2

4 2 3 1 7

$upper.approximation$Reject

Low No Low Yes1 Low Yes2 Medium Yes1 Medium Yes2

8 5 6 1 7

$type.model

[1] "RST"

attr(,"class")

[1] "LowerUpperApproximation" "list"

- The Positive Region and Degree of Dependency

R> region <- BC.positive.reg.RST(hiring.dt, roughset)

R> print(region)

$positive.reg

[1] 2 3 4 5 6 8

$degree.dependency

[1] 0.75

$type.model

[1] "RST"

attr(,"class")

[1] "PositiveRegion" "list"

- The Discernibility Matrix

Furthermore, we can also construct the discernibility matrix as follows.

R> disc.Mat <- BC.discernibility.mat.RST(hiring.dt)

R> print(disc.Mat)

$disc.list

$disc.list[[1]]

[1] "Experience" "Reference"

$disc.list[[2]]

[1] "Diploma" "Experience" "Reference"

$disc.list[[3]]

[1] "Diploma" "Reference"

$disc.list[[4]]

[1] "Diploma" "Experience" "French"

$disc.list[[5]]

[1] "Diploma" "Experience"

$disc.list[[6]]

[1] "Experience"

$disc.list[[7]]

[1] "Diploma" "Experience" "French" "Reference"

$disc.list[[8]]

[1] "Experience" "French" "Reference"

$names.attr

[1] "Diploma" "Experience" "French" "Reference" "Decision"

$type.discernibility

[1] "RST"

$type.model

[1] "RST"

attr(,"class")

[1] "DiscernibilityMatrix" "list"