'Calculate approximate perplexity for data X.
Perplexity is defined as exp(-1. * log-likelihood per word)
.. versionchanged:: 0.19
*doc_topic_distr* argument has been deprecated and is ignored
because user no longer has access to unnormalized distribution
Parameters
X : array-like or sparse matrix, [n_samples, n_features]
Document word matrix.
doc_topic_distr : None or array, shape=(n_samples, n_components)
Document topic distribution.
This argument is deprecated and is currently being ignored.
.. deprecated:: 0.19
sub_sampling : bool
Do sub-sampling or not.
Returns
score : float
Perplexity score.'

def perplexity(self, X, doc_topic_distr='deprecated', sub_sampling=False):

    if (doc_topic_distr != 'deprecated'):
        warnings.warn("Argument    'doc_topic_distr'    is    deprecated    and    is    being    ignored    as    of    0.19.    Support    for    this    argument    will    be    removed    in    0.21.", DeprecationWarning)
    return self._perplexity_precomp_distr(X, sub_sampling=sub_sampling)
