Learn R Programming

⚠️There's a newer version (2.2.5) of this package.Take me there.

BayesMallows (version 1.1.0)

Bayesian Preference Learning with the Mallows Rank Model

Description

An implementation of the Bayesian version of the Mallows rank model (Vitelli et al., Journal of Machine Learning Research, 2018 ; Crispino et al., Annals of Applied Statistics, 2019 ). Both Metropolis-Hastings and sequential Monte Carlo algorithms for estimating the models are available. Cayley, footrule, Hamming, Kendall, Spearman, and Ulam distances are supported in the models. The rank data to be analyzed can be in the form of complete rankings, top-k rankings, partially missing rankings, as well as consistent and inconsistent pairwise preferences. Several functions for plotting and studying the posterior distributions of parameters are provided. The package also provides functions for estimating the partition function (normalizing constant) of the Mallows rank model, both with the importance sampling algorithm of Vitelli et al. and asymptotic approximation with the IPFP algorithm (Mukherjee, Annals of Statistics, 2016 ).

Copy Link

Version

Install

install.packages('BayesMallows')

Monthly Downloads

944

Version

1.1.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Oystein Sorensen

Last Published

December 3rd, 2021

Functions in BayesMallows (1.1.0)

calculate_backward_probability

Calculate Backward Probability
compute_rho_consensus

Compute rho consensus
compute_posterior_intervals_rho

Compute Posterior Intervals Rho
compute_posterior_intervals_alpha

Compute Posterior Intervals Alpha
correction_kernel_pseudo

Correction Kernel (pseudolikelihood)
compute_mallows_mixtures

Compute Mixtures of Mallows Models
generate_constraints

Generate Constraint Set from Pairwise Comparisons
generate_initial_ranking

Generate Initial Ranking
compute_posterior_intervals.BayesMallows

Compute posterior intervals
.generate_transitive_closure

Internal function for generating transitive closure
compute_posterior_intervals

Compute Posterior Intervals
compute_posterior_intervals.SMCMallows

Compute posterior intervals
get_partition_function

Compute the logarithm of the partition function for a Mallows rank model
get_rank_distance

Compute the Distance between two rankings
leap_and_shift_probs

Leap and Shift Probabilities
rank_distance

Distance between a set of rankings and a given rank sequence
rank_freq_distr

Frequency distribution of the ranking sequences
lik_db_mix

Likelihood and log-likelihood evaluation for a Mallows mixture model
metropolis_hastings_aug_ranking_pseudo

Metropolis-Hastings Augmented Ranking (pseudolikelihood)
potato_weighing

Result of ranking potatoes by weight, where the assessors were allowed to lift the potatoes. 12 assessors ranked 20 potatoes.
metropolis_hastings_aug_ranking

Metropolis-Hastings Augmented Ranking
potato_visual

Result of ranking potatoes by weight, where the assessors were only allowed to inspected the potatoes visually. 12 assessors ranked 20 potatoes.
compute_consensus.BayesMallows

Compute Consensus Ranking
compute_mallows

Preference Learning with the Mallows Rank Model
compute_importance_sampling_estimate

Compute importance sampling estimates of log partition function for footrule and Spearman distances.
smc_processing

SMC Processing
smc_mallows_new_users_partial_alpha_fixed

SMC-mallows new users partial (alpha fixed)
log_expected_dist

Compute the logarithm of the expected distance of metrics for a Mallows rank model
metropolis_hastings_alpha

Metropolis-Hastings Alpha
generate_transitive_closure

Generate Transitive Closure
get_mallows_loglik

Get Mallows log-likelihood
label_switching

Checking for Label Switching in the Mallows Mixture Model
plot_top_k

Plot Top-k Rankings with Pairwise Preferences
get_sample_probabilities

Get Sample Probabilities
plot_rho_posterior

Plot the posterior for rho for each item
print.BayesMallowsMixtures

Print Method for BayesMallowsMixtures Objects
plot_elbow

Plot Within-Cluster Sum of Distances
correction_kernel

Correction Kernel
sample_dataset

A synthetic 3D matrix (n_users, n_items, Time) generated using the sample_mallows function. These are test datasets used to run the SMC-Mallows framework for the cases where we know all of the users in our system and their original ranking information are partial rankings. However at some point in time, we observe extra information about an existing user in the form of a rank for an item that was previously not known (NA). These datasets are very contrived as the first time step (sample_dataset[, , 1]) we observed the top m / 2 items from each user, where m is the number of items in a ranking. Then, as we increase the time, we observe the next top ranked item from one user at a time, then the next top ranked item, and so on until we have a complete dataset at sample_dataset[, , Time].
sample_mallows

Random Samples from the Mallows Rank Model
potato_true_ranking

True ranking of the weights of 20 potatoes.
estimate_partition_function

Estimate Partition Function
plot_alpha_posterior

Plot Alpha Posterior
run_mcmc

Worker function for computing the posterior distribution.
plot.BayesMallows

Plot Posterior Distributions
sushi_rankings

Sushi Rankings
rmallows

Sample from the Mallows distribution.
rank_conversion

Convert between ranking and ordering.
metropolis_hastings_rho

Metropolis-Hastings Rho
obs_freq

Observation frequencies in the Bayesian Mallows model
expected_dist

Expected value of metrics under a Mallows rank model
validate_permutation

Check if a vector is a permutation
print.BayesMallows

Print Method for BayesMallows Objects
predict_top_k

Predict Top-k Rankings with Pairwise Preferences
smc_mallows_new_users_complete

SMC-Mallows New Users Complete
smc_mallows_new_item_rank

SMC-Mallows new users rank
smc_mallows_new_users_partial

SMC-Mallows new users partial
smc_mallows_new_item_rank_alpha_fixed

SMC-Mallows new item rank (alpha fixed)
compute_consensus.consensus_SMCMallows

Compute Consensus Ranking
asymptotic_partition_function

Asymptotic Approximation of Partition Function
BayesMallows

BayesMallows: Bayesian Preference Learning with the Mallows Rank Model.
compute_consensus

Compute Consensus Ranking
calculate_forward_probability

Calculate Forward Probability
assess_convergence

Trace Plots from Metropolis-Hastings Algorithm
assign_cluster

Assign Assessors to Clusters
beach_preferences

Beach Preferences