View source: R/ls.sorting.treatment.R
ls.sorting.treatment | R Documentation |
This function assigns alternatives to classes and optionally compares
the obtained classification to a given one. The classes are
described by a set of prototypes (well-known alternatives for the
decision maker) and a capacity (which can, for instance, be determined by
ls.sorting.capa.ident
). This function (in combination with
ls.sorting.capa.ident
) is an
implementation of the TOMASO method; see Meyer and Roubens (2005).
ls.sorting.treatment(P, cl.proto, a, A, cl.orig.A = NULL)
P |
Object of class |
cl.proto |
Object of class |
a |
Object of class |
A |
Object of class |
cl.orig.A |
Object of class |
The function returns a list structured as follows:
correct.A |
Object of class |
class.A |
Object of class |
eval.correct |
Object of class |
minmax.P |
Object of class |
Choquet.A |
Object of class |
P. Meyer, M. Roubens (2005), Choice, Ranking and Sorting in Fuzzy Multiple Criteria Decision Aid, in: J. Figueira, S. Greco, and M. Ehrgott, Eds, Multiple Criteria Decision Analysis: State of the Art Surveys, volume 78 of International Series in Operations Research and Management Science, chapter 12, pages 471-506. Springer Science + Business Media, Inc., New York.
Mobius.capacity-class
,
mini.var.capa.ident
,
mini.dist.capa.ident
,
ls.sorting.capa.ident
,
least.squares.capa.ident
,
heuristic.ls.capa.ident
,
entropy.capa.ident
.
## generate a random problem with 10 prototypes and 4 criteria
n.proto <- 10 ## prototypes
n <- 4 ## criteria
P <- matrix(runif(n.proto*n,0,1),n.proto,n)
## the corresponding global scores, based on a randomly generated
## capacity a
glob.eval <- numeric(n.proto)
a <- capacity(c(0:(2^n-3),(2^n-3),(2^n-3))/(2^n-3))
for (i in 1:n.proto)
glob.eval[i] <- Choquet.integral(a,P[i,])
## based on these global scores, let us create a classification (3 classes)
cl.proto<-numeric(n.proto)
cl.proto[glob.eval <= 0.33] <- 1
cl.proto[glob.eval > 0.33 & glob.eval<=0.66] <-2
cl.proto[glob.eval > 0.66] <- 3
## search for a capacity which satisfies the constraints
lsc <- ls.sorting.capa.ident(n ,4, P, cl.proto, 0.1)
## output of the QP
lsc$how
## analyse the quality of the model (classify the prototypes by the
## model and compare both assignments)
lst <- ls.sorting.treatment(P,cl.proto,lsc$solution,P,cl.proto)
## assignments of the prototypes
lst$class.A
## assignment types
lst$correct.A
## evaluation
lst$eval.correct
## generate a second set of random alternatives (A)
## their "correct" class is determined as beforehand with the
## randomly generated capacity a
## the goal is to see if we can reproduce this classification
## by the capacity learnt from the prototypes
## a randomly generated criteria matrix of 10 alternatives
A <- matrix(runif(10*n,0,1),10,n)
cl.orig.A <-numeric(10)
## the corresponding global scores
glob.eval.A <- numeric(10)
for (i in 1:10)
glob.eval.A[i] <- Choquet.integral(a,A[i,])
## based on these global scores, let us determine a classification
cl.orig.A[glob.eval.A <= 0.33] <- 1
cl.orig.A[glob.eval.A>0.33 & glob.eval.A<=0.66] <-2
cl.orig.A[glob.eval.A > 0.66] <- 3
## let us now classify the alternatives of A according to the model
## built on P
lst <- ls.sorting.treatment(P,cl.proto,lsc$solution,A,cl.orig.A)
## assignment of the alternatives of A
lst$class.A
## type of assignments
lst$correct.A
## evaluation
lst$eval.correct
## show the learnt capacity
## x11()
## barplot(Shapley.value(lsc$solution), main="Learnt capacity", sub="Shapley")
## summary of the learnt capacity
lsc$solution
summary(lsc$solution)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.