library("pks")
## Create competence structure
CStr <- as.binmat(c("0000", "0100", "1100", "1010", "1110", "0111", "1111"))
rownames(CStr) <- as.pattern(CStr)
## Create competency set
T_ <- c("a", "b", "c", "ab", "ac", "ad", "bc", "bd", "cd", "abc", "abd",
"acd", "bcd", "abcd")
## Create design matrices
DesignMat <- upper.tri(matrix(0, nrow(CStr), nrow(CStr))) + 0
colnames(DesignMat) <- rownames(DesignMat) <-
as.pattern(CStr, useNames = TRUE)
DesignMat2 <- DesignMat
DesignMat2[1, ] <- c(0, 0, 0, 1, 1, 1, 1)
DesignMat2[3, ] <- c(0, 0, 0, 1, 1, 0, 0)
## Create manually defined preference relation
ManDef_PR <- c("a, ac, ad, abc, abd, abcd",
"b, bc, cd, acd",
"ab, bd, bcd",
"c")
class(ManDef_PR) <- "DeletionRule"
## Classic examples from Anselmi et al. (2024)
## Basic version using preference relation "NSP"
cdp(Competencies = T_, CS = CStr, prefRel = "NSP")
Competency Deletion Procedure (CDP) Results
Achieved Reduct:
a b cd abc
Number of Iterations: 10
Deleted Competencies in chronological order:
c bd abd abcd bc bcd ac ad ab acd
Chosen method for creating the preference relation: NSP
Preference Relation:
NSP does not use a Preference Relation
## Larger output option and preference relation "FSP"
cdp(Competencies = T_, CS = CStr, prefRel = "FSP", verbose = TRUE)
Competency Deletion Procedure (CDP) Results
Achieved Reduct:
a b c ad
Number of Iterations: 10
Deleted Competencies in chronological order:
abcd abd acd bcd abc cd bd ab ac bc
Chosen method for creating the preference relation:
FSP
Preference Relation:
a, b, c
ab, ac, ad, bc, bd, cd
abc, abd, acd, bcd
abcd
Bag Matrix (Delta)
a b c ad
{}/ab 1 1 0 0
{}/abc 1 1 1 0
{}/abcd 1 1 1 1
{}/ac 1 0 1 0
{}/b 0 1 0 0
{}/bcd 0 1 1 0
ab/abc 0 0 1 0
ab/abcd 0 0 1 1
ab/ac 0 1 1 0
ab/bcd 1 0 1 0
abc/abcd 0 0 0 1
abc/bcd 1 0 0 0
ac/abc 0 1 0 0
ac/abcd 0 1 0 1
ac/bcd 1 1 0 0
b/ab 1 0 0 0
b/abc 1 0 1 0
b/abcd 1 0 1 1
b/ac 1 1 1 0
b/bcd 0 0 1 0
bcd/abcd 1 0 0 1
Used Competencies (T):
a b c ab ac ad bc bd cd abc abd acd bcd abcd
Used Competence Structure (CS):
a b c d
0000 0 0 0 0
0100 0 1 0 0
1100 1 1 0 0
1010 1 0 1 0
1110 1 1 1 0
0111 0 1 1 1
1111 1 1 1 1
Used Design Matrix:
{} b ab ac abc bcd abcd
{} 0 1 1 1 1 1 1
b 0 0 1 1 1 1 1
ab 0 0 0 1 1 1 1
ac 0 0 0 0 1 1 1
abc 0 0 0 0 0 1 1
bcd 0 0 0 0 0 0 1
abcd 0 0 0 0 0 0 0
## Classic complete design matrix and preference relation "MBP"
cdp(Competencies = T_, CS = CStr, prefRel = "MBP", DesignMat = DesignMat)
Competency Deletion Procedure (CDP) Results
Achieved Reduct:
b c ab cd
Number of Iterations: 10
Deleted Competencies in chronological order:
abd acd ad abcd bcd abc bd bc ac a
Chosen method for creating the preference relation:
MBP
Preference Relation:
a, c, ab, ac, bc
b, bd, cd, abc, bcd
ad, abd, acd, abcd
## Reduced design matrix and preference relation "MSP"
cdp(Competencies = T_, CS = CStr, prefRel = "MSP", DesignMat = DesignMat2)
Competency Deletion Procedure (CDP) Results
Achieved Reduct:
ab ac bcd
Number of Iterations: 11
Deleted Competencies in chronological order:
a c b bd bc cd ad abd acd abc abcd
Chosen method for creating the preference relation:
MSP
Preference Relation:
abcd
abc, abd, acd, bcd
ab, ac, ad, bc, bd, cd
a, b, c
## Manually defined preference relation
cdp(Competencies = T_, CS = CStr, prefRel = ManDef_PR)
Competency Deletion Procedure (CDP) Results
Achieved Reduct:
a b ad bc
Number of Iterations: 10
Deleted Competencies in chronological order:
c bd bcd ab acd cd abd abc abcd ac
Chosen method for creating the preference relation:
manually defined
Preference Relation:
a, ac, ad, abc, abd, abcd
b, bc, cd, acd
ab, bd, bcd
c