Learn R Programming

svs (version 1.1.0)

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:

prob0

The probabilities of the latent classes.

prob1

The 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.

prob2

The probabilities for the second set of levels (viz. the column levels of a frequency table). The columns of prob2 sum to 1.

Details

From version 1.1.0 of the svs package on, probabilistic latent semantic analysis is a special case of latent class analysis.

References

Hofmann, Th. (1999). Probabilistic latent semantic indexing. SIGIR'99: Proceedings of the 22nd annual international SIGIR conference on research and development in information retrieval, 50--57.

Examples

Run this code
# NOT RUN {
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
# }

Run the code above in your browser using DataLab