# Load the USPS data and discard peripheral digits
data(USPSdigits)
ylab <- USPSdigits$train[,1]
train <- USPSdigits$train[,-1]
ind <- apply(train, 2, sd) > 0.7
dat <- train[,ind]
# Fit an IMIFA model (warning: quite slow!)
# sim <- mcmc_IMIFA(dat, n.iters=1000, prec.mu=1e-03, z.init="kmeans",
# centering=FALSE, scaling="none")
# res <- get_IMIFA_results(sim, zlabels=ylab)
# Examine the posterior mean image of the first two clusters
# show_IMIFA_digit(res, dat=train, ind=ind)
# show_IMIFA_digit(res, dat=train, ind=ind, G=2)
Run the code above in your browser using DataLab