model | R Documentation |
This function applies the proposed method of Hermes (2025) on a given set of ratings, user covariates and item covariates. This implementation allows for the same flexibility as in the Hermes (2025) paper, namely linear and bilinear predictors, sparsity and latent factors. Returns posterior samples for the parameter estimates and posterior predictive samples for the missing ratings.
model(X, Y, R, k, l, method, sparse, mcmc_samples, burnin, verbose)
X |
A |
Y |
A |
R |
A |
k |
Integer value indicating the maximum rating that a user can provide. |
l |
Number of latent factors. |
method |
Method choice, either |
sparse |
Boolean value indicating whether sparsity should be imposed on |
mcmc_samples |
Total number of Gibbs samples. |
burnin |
Number of Gibbs samples that are used as burnin. |
verbose |
Boolean value indicating whether parameter estimation progress is returned ( |
B_hat |
A |
U_hat |
A |
V_hat |
A |
R_hat |
A |
Sjoerd Hermes
Maintainer: Sjoerd Hermes sjoerd.hermes@wur.nl
1. Hermes, S. (2025). A Statistical Interpretation of Multi-Item Rating and Recommendation Problems. arXiv preprint, arXiv:2503.02786.
# Set parameters
n = m = 15
p = q = 3
method = "linear"
k = 5
l = 1
sparse = TRUE
# Generate some data
# this is completely random, and there is no relation between the ratings
# and the covariates or latent factors
set.seed(2025)
r = matrix(rbinom(n*m, k, 0.3), n, m)
X = matrix(rnorm(n * p), n, p)
Y = matrix(rnorm(m * q), m, q)
# Fit the model on the data
est = model(X, Y, r, k, l, method, sparse, mcmc_samples = 2000, burnin = 1000, TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.