Description Usage Arguments Details Value Author(s) References See Also Examples
These functions can be used to create, combine and print basic probability assignment objects for classificiation. A Basic Probabilty Assignment is a similar to a probabilty mass function, except that it has an additional mass for the concept for "ignorance".
1 2 3 |
n |
The number of distinct values that need to be represented. Usually set to the number of classes in the data. |
setlist |
A subset of 1: |
mlist |
The actual masses assigned to the elements in the |
x |
The bpa object to be printed. |
verbose |
If FALSE (default), simply prints out the basic probability assignment. If TRUE, prints a list of all member functions as well. |
... |
Additional arguments to print method. Not Used. |
It should be noted that these functions are fairly simplistic, since they were designed to be fast, and work with classification only. In particular, if you have set-valued elements, the combination function will likely give the wrong answer unless the sets are non-intersecting. For the same reason, belief functions have not been implemented either, since for atomic elements, bpa = belief function.
The bpa
function returns a list of functions which can be used to
query and / or manipulate the create bpa object.
get.N |
Get the number of distinct values represented in the bpa. Usually set to the number of classes. |
get.setlist |
Get the sets represented in the bpa |
get.full.m |
Get the masses assigned to each of the elements. |
get.focal.elements |
Get only those elements that have a positive mass attached to them. Such elements are called the focal elements of the bpa. |
get.m |
Get the masses attached only to the focal elements, that is the non-zero elements of the mlist. |
get.mass |
Get the masses attached to certain specified elements
of the bpa. The elements are specifed as a vector via the argument |
assign.bpa |
Can be used to re-assign mass to certain specified
elements of the bpa. The argument |
get.assigned.class |
Returns a vector of all possible classes, in decreasing order of assigned probabilty. (That is, the first element is the most likely class, and the last element is the least likely class.) |
get.assigned.ratios |
Returns a vector of length |
set.name |
Can be passed a string to name the |
get.name |
Returns the name of the |
set.info |
Can be used to store as auxiliary information. (Used
internally by the |
get.info |
Returns whatever was stored as info. If empty,
|
Mohit Dayal
Gordon, J. and Shortliffe, E. H. (1984). The dempster-shafer theory of evidence. Rule-Based Expert Systems: The MYCIN Experiments of the Stanford Heuristic Programming Project, 3:832-838. Shafer, G. (1986). The combination of evidence. International Journal of Intelligent Systems, 1(3):155-179.
combine.bpa.bs, combine.bpa.ds, combine.bpa.list.ds, combine.bpa.list.ds
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | ##Empty bpa - All mass is attached to ignorance
b1 <- bpa(3)
b1
##Add a set to this bpa
b1$assign.bpa(s = c(1,2), m = c(0.3,0.4))
print(b1, verbose = TRUE)
##The same thing in a different way - classes can be named
##Note that the print method omits empty classes
b0 <- bpa(3, c('A','B','C', Inf), c(0.3, 0.4, 0, 0.3))
b0
##Another bpa
##Again, class '2' has been omitted
b2 <- bpa(3)
b2$assign.bpa(s = c(1,3), m = c(0.7,0.1))
b2
##Combine
b3 <- combine.bpa.ds(b1,b2)
b3
combine.bpa.bs(b1,b2)
##As a list, should be same answer as above
b4 <- combine.bpa.list.ds(list(b1,b2))
b4
combine.bpa.list.bs(list(b1,b2))
|
Warning message:
no DISPLAY variable so Tk is not available
A bpa object.
Inf
1
A bpa object.
1 2 Inf
0.3 0.4 0.3
The following functions are available:
[1] "get.N" "get.setlist" "get.full.m"
[4] "get.focal.elements" "get.m" "get.mass"
[7] "assign.bpa" "get.assigned.class" "get.assigned.ratios"
[10] "set.name" "get.name" "set.info"
[13] "get.info"
A bpa object.
A B Inf
0.3 0.4 0.3
A bpa object.
1 3 Inf
0.7 0.1 0.2
A bpa object.
1 2 3 Inf
0.48 0.08 0.03 0.41
A bpa object.
1 Inf
0.7777778 0.2222222
A bpa object.
1 2 3 Inf
0.48 0.08 0.03 0.41
A bpa object.
1 Inf
0.7777778 0.2222222
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.