Learn R Programming

svs (version 1.0.2)

fast_psa: Probabilistic Latent Semantic Analysis

Description

A fast procedure for computing probabilistic latent semantic analysis.

Usage

fast_psa(dat, k, symmetric = FALSE, tol = 1e-08)

fast_psi(dat, k, symmetric = FALSE, tol = 1e-08)

fast_plsa(dat, k, symmetric = FALSE, tol = 1e-08)

fast_plsi(dat, k, symmetric = FALSE, tol = 1e-08)

Arguments

dat
Input data: can be a table or a data frame (but the data frame must have only two columns).
k
Numeric specification of the number of latent classes to compute.
symmetric
Logical indicating whether to compute the symmetric or the asymmetric solution.
tol
Numeric specification of the convergence criterion.

Value

  • A list with components:
  • prob0The probabilities of the latent classes.
  • prob1The probabilities for the first set of levels (viz. the row levels of a frequency table). The rows of prob1 sum to 1 if symmetric = FALSE, the columns sum to 1 if symmetric = TRUE.
  • prob2The probabilities for the second set of levels (viz. the column levels of a frequency table). The rows of prob2 sum to 1.

Examples

Run this code
SndT_Fra <- read.table(system.file("extdata", "SndT_Fra.txt", package = "svs"),
   header = TRUE, sep = "\t", quote = "\"", encoding = "UTF-8")
psa.SndT_Fra <- fast_psa(SndT_Fra, k = 7)
psa.SndT_Fra
}
references{
Hofmann, Th. (1999). Probabilistic latent semantic indexing.
  emph{SIGIR'99: Proceedings of the 22nd annual international SIGIR conference on research and development in information retrieval}, 50--57.
}

Run the code above in your browser using DataLab