hypertools.tools.gensim_models.LsiVectorizer

class hypertools.tools.gensim_models.LsiVectorizer(num_topics=20, seed=0)[source]

Semantic-stage model: gensim’s LsiModel (Latent Semantic Indexing) trained over a bag-of-words corpus built internally from a dense document-term matrix. transform returns dense (n_docs, num_topics) projections (unlike LDA these are signed real values, not probabilities – they do not sum to 1).

Parameters:
num_topicsint

Number of latent dimensions. Default: 20.

seedint or None

Random seed for reproducible training (gensim’s random_seed). Default: 0.

Attributes:
model_gensim.models.LsiModel

The trained LSI model (set by fit).

n_features_int

Vocabulary size seen during fit; transform requires the same width.

Methods

fit(X[, y])

Fit an LSI model to a dense document-term matrix.

fit_transform(X[, y])

Fit to data, then transform it.

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

set_output(*[, transform])

Set output container.

set_params(**params)

Set the parameters of this estimator.

transform(X)

Compute LSI projections for a dense document-term matrix.

__init__(num_topics=20, seed=0)[source]

Methods

__init__([num_topics, seed])

fit(X[, y])

Fit an LSI model to a dense document-term matrix.

fit_transform(X[, y])

Fit to data, then transform it.

get_metadata_routing()

Get metadata routing of this object.

get_params([deep])

Get parameters for this estimator.

set_output(*[, transform])

Set output container.

set_params(**params)

Set the parameters of this estimator.

transform(X)

Compute LSI projections for a dense document-term matrix.