项目作者: jlepird

项目描述 :
A Bayesian algorithm for pairwise preference elicitation
高级语言: R
项目地址: git://github.com/jlepird/prefeR.git
创建时间: 2016-05-07T21:26:26Z
项目社区:https://github.com/jlepird/prefeR

开源协议:Other

下载


Package Status

R
CRAN_Status_Badge

What is preference elicitation?

Most real-world decisions must reconcile multiple, competing objectives. In buying a car, you might be concerned about cost, reliability, and performance, but before you can make a decision, you must establish the relative importance of these goals. A common mathematical approach to this problem is to define weights for each of these objectives. Although you might have a ballpark intuition for the weights, it is difficult to set them in a repeatable and defendable manner.

Preference elicitation relieves some of this burden. Instead of determining the weights directly, you make a series of pairwise comparisons between alternatives: do you prefer car A, car B, or are you indifferent? Research has shown that these pairwise comparisons are far easier to make and much easier to justify than explicitly setting the weights directly. This package implements a preference elicitation algorithm that takes your stated preferences and uses them to calculate an optimal set of weights. It can even suggest which comparisons you should make to get the most accurate weights with the fewest number of queries.

Technical details about how this package works can be found in the article here.

Installation

This package is on CRAN, so you can install it directly through install.packages().

  1. install.packages("prefeR")

Examples

Hello, World

  1. library(prefeR)
  2. Sys.sleep(20)
  3. # Each column of data is a variable, i.e. objective,
  4. # and each row is an alternative.
  5. p <- prefEl(data = data.frame(x = c(1, 0, 1),
  6. y = c(0, 1, 1)))
  7. # Set the prior belief on the weights for objectives x and y
  8. p$priors <- c(Normal(0, 1),
  9. Normal(0, 1))
  10. # Add in some pairwise preferences
  11. p$addPref(1 %>% 3) # prefer row 1 to row 3
  12. p$addPref(3 %<% 2) # prefer row 2 to row 3
  13. # Run the inference
  14. p$infer() # returns that x and y are of equal importance
  15. # What comparision should you make next?
  16. p$suggest() # suggest compare 1 to 2
  17. p$addPref(1 %=% 2)
  18. # Re-run the infernence algorithm
  19. p$infer() # maintains belief that 1 and 2 are equal
  20. p$rank() # calculates the value of all three alternatives

More Examples

Choosing a car from the mtcars dataset