explainAssignment: Explain assignment

Description Usage Arguments Value See Also Examples

View source: R/explanations.R

Description

This function allows to obtain explanation of an alternative assignment to a specific class interval or one class in case if assignment is necessary. The function returns all preferential reducts for an assignment relation.

Usage

1
explainAssignment(alternative, classInterval, problem)

Arguments

alternative

Index of an alternative.

classInterval

Two-element vector c(l, u) that represents an assignment of alternative to class interval [C_l, C_u] (l <= u).

problem

Problem for which computations will be performed.

Value

List of all preferential reducts for an assignment relation. If the assignment is not influenced by restrictions then empty list will be returned. Each element of the list is a preferential reduct represented as a vector of restriction indices. To identify preferential core use getPreferentialCore. To find out about restrictions by their indices use getRestrictions.

See Also

getPreferentialCore getRestrictions calculateAssignments

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
perf <- matrix(c(5, 2, 1, 7, 0.5, 0.9, 0.4, 0.5), ncol = 2)
problem <- buildProblem(perf, 3, FALSE, c('g', 'g'), c(0, 0))
problem <- addAssignmentsLB(problem, c(1, 2), c(2, 3))

possibleAssignments <- calculateAssignments(problem, FALSE)
alternative <- 4
assignment <- c(min(which(possibleAssignments[alternative, ])),
               max(which(possibleAssignments[alternative, ])))

preferentialReducts <- explainAssignment(alternative,
   assignment, problem)
preferentialCore <- getPreferentialCore(preferentialReducts)
coreRestrictions <- getRestrictions(problem, preferentialCore)

rorutadis documentation built on May 2, 2019, 8:51 a.m.