fast_psa: Probabilistic Latent Semantic Analysis

Description Usage Arguments Details Value References Examples

View source: R/svs.r


A fast procedure for computing probabilistic latent semantic analysis.


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)



Input data: can be a table or a data frame (but the data frame must have only two columns).


Numeric specification of the number of latent classes to compute.


Logical indicating whether to compute the symmetric or the asymmetric solution.


Numeric specification of the convergence criterion.


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


A list with components:


The probabilities of the latent classes.


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.


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


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.


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)

Example output

[1] 0.27848357 0.22352699 0.13517149 0.13504458 0.10440166 0.06307939 0.06029233

                          1             2          3             4
aanvang        2.720405e-01  6.867748e-01 0.00000000 4.688561e-268
begin          3.947527e-26  1.000000e+00 0.00000000 1.382359e-155
beginnen       8.116862e-01  4.333084e-02 0.01215805  1.736829e-02
eerst          2.513404e-55  7.255699e-10 0.00000000  1.000000e+00
gaan           1.972993e-40 1.270483e-287 0.00000000 2.170458e-196
komen          1.482403e-15 1.124232e-260 0.00000000 1.920956e-182
krijgen        1.257451e-43  0.000000e+00 0.00000000  0.000000e+00
ontstaan       5.000000e-02  3.000000e-01 0.00000000 1.377965e-268
openen         9.427441e-42 1.136060e-315 0.00000000 5.250556e-187
oprichten      1.000000e+00 1.997592e-250 0.00000000  0.000000e+00
opstarten      1.000000e+00 6.941425e-248 0.00000000  0.000000e+00
opzetten       2.917092e-01 6.939143e-250 0.00000000  0.000000e+00
start          5.523044e-02  8.857010e-01 0.00000000 1.053769e-276
starten        8.472701e-01  2.016794e-02 0.02000000  1.097115e-02
van start gaan 8.987096e-01 1.104797e-227 0.00000000 9.368717e-266
vanaf          0.000000e+00  0.000000e+00 1.00000000  0.000000e+00
worden         2.992817e-01  0.000000e+00 0.00000000 1.945420e-202
                           5             6             7
aanvang         0.000000e+00  4.118476e-02 1.047045e-158
begin          1.053716e-315 2.821289e-148 5.166060e-122
beginnen        1.229889e-02  2.182736e-03  1.009750e-01
eerst           0.000000e+00 1.713717e-212 2.913167e-145
gaan            0.000000e+00  1.797531e-15  1.000000e+00
komen           1.239141e-02  9.876086e-01  6.138302e-42
krijgen         1.666667e-01  7.861295e-01  4.720379e-02
ontstaan        6.500000e-01  0.000000e+00  0.000000e+00
openen          1.000000e+00 1.035534e-162 1.753863e-141
oprichten      2.526231e-208  1.118084e-55  0.000000e+00
opstarten      7.962496e-236  2.921119e-62 2.173751e-131
opzetten        5.297866e-01  1.680712e-53  1.785041e-01
start          1.933068e-228  2.038912e-55  5.906853e-02
starten         5.063694e-02  9.040580e-03  4.191334e-02
van start gaan 6.782839e-275  1.012904e-01 4.025852e-134
vanaf           0.000000e+00  0.000000e+00  0.000000e+00
worden          0.000000e+00  3.020936e-01  3.986247e-01

                            1             2             3             4
<U+00E0> partir de 2.909046e-17 4.280144e-229  1.000000e+00 1.112932e-250
commencer        4.676135e-01  9.590341e-03 1.127592e-251  8.301710e-02
d'abord          4.064435e-15 2.127862e-234 2.351826e-266  8.963640e-01
d<U+00E9>but       1.319865e-13  9.743516e-01 9.827774e-261  2.061893e-02
d<U+00E9>butant    2.414846e-02 9.372938e-220 2.592872e-246 6.306131e-239
d<U+00E9>buter     1.401341e-01  1.173704e-02 3.083265e-264 3.064141e-240
d<U+00E9>marrer    8.650123e-02 1.125097e-259 2.037513e-248 2.967661e-275
entamer          1.279868e-01  3.637196e-54 3.222762e-266 2.804180e-246
entreprendre     8.657557e-03 6.551493e-230 2.726330e-282 1.116869e-253
entrer           8.241854e-10 4.636498e-158 1.113698e-259 8.132640e-241
lancer           1.015318e-01  4.321041e-03 9.271070e-303 6.554352e-300
lancer, se       2.307977e-02 3.458992e-218 5.010281e-255 3.795299e-239
mettre, se       1.037582e-26 4.921316e-230 1.021667e-283 3.568671e-254
ouvrir           1.719935e-17 3.856553e-204 4.697461e-262 1.169311e-251
partir           2.677273e-09 2.291397e-124 5.062272e-245 1.208339e-255
prendre cours    1.207423e-02  5.362722e-33 2.721748e-273 2.759440e-234
recommencer      8.272482e-03 1.151976e-212 2.580209e-264 1.795099e-234
                             5             6            7
<U+00E0> partir de 1.678921e-211 8.211723e-301 1.437261e-68
commencer         6.900858e-03  4.494071e-02 1.473846e-01
d'abord          4.395988e-220 9.035869e-276 2.081960e-76
d<U+00E9>but       8.257671e-144 9.509876e-250 6.309077e-62
d<U+00E9>butant    2.060090e-191 2.869902e-278 1.606041e-59
d<U+00E9>buter     2.551129e-211  3.422728e-02 2.072440e-02
d<U+00E9>marrer    1.583524e-141  3.389587e-02 1.018459e-97
entamer           2.096092e-23 4.831766e-103 2.328699e-38
entreprendre     4.279133e-261  0.000000e+00 3.808905e-02
entrer           4.855633e-196  7.660152e-01 6.857983e-02
lancer            7.561868e-03  6.764422e-02 1.425269e-86
lancer, se       3.569065e-117 2.585038e-138 9.416743e-02
mettre, se       8.667979e-217  5.327676e-02 3.234933e-01
ouvrir            9.855373e-01  2.114907e-12 1.657316e-67
partir           7.169305e-174 1.205145e-260 2.900015e-01
prendre cours    8.607759e-253 3.862089e-146 2.586758e-58
recommencer      2.601419e-243  1.449938e-84 1.755985e-02

svs documentation built on May 29, 2017, 10:25 a.m.