tlda
.ThirdOrderCumulant
- class tlda.ThirdOrderCumulant(n_topic, alpha_0, n_iter_train, n_iter_test, batch_size, learning_rate, gamma_shape=1.0, theta=1, ortho_loss_criterion=1000, seed=None, n_eigenvec=None, learning_rate_criterion=1e-05)[source]
Class to compute the third order cumulant
Methods
fit
(X[, verbose])Update the factors directly from X using stochastic gradient descent
partial_fit
(X_batch[, learning_rate])Update the factors directly from the batch using stochastic gradient descent
predict
(X_test, adjusted_factors, weights)Infer the document/topic distribution from the factors and weights and make the factor non-negative
- partial_fit(X_batch, learning_rate=None)[source]
Update the factors directly from the batch using stochastic gradient descent
- Parameters:
- X_batchndarray of shape (number_documents, num_topics) equal to the whitened
word counts in each document in the documents used to update the factors
- verbosebool, optional
if True, print information about every 200th iteration
- fit(X, verbose=True)[source]
Update the factors directly from X using stochastic gradient descent
- Parameters:
- Xndarray of shape (number_documents, num_topics) equal to the whitened
word counts in each document in the documents used to update the factors
- predict(X_test, adjusted_factors, weights)[source]
Infer the document/topic distribution from the factors and weights and make the factor non-negative
- Parameters:
- X_testndarray of shape (number_documents, vocabulary_size) equal to the word
counts in each test document
- Returns:
- gammadtensor of shape (number_documents, number_topics) equal to
the normalized document/topic distribution for X_test