Contents

scikits.learn.feature_extraction.text.TfidfTransformer

class scikits.learn.feature_extraction.text.TfidfTransformer(use_idf=True)

Transform a count matrix to a TF (term-frequency) or TF-IDF (term-frequency inverse-document-frequency) representation.

Methods

fit
transform
__init__(use_idf=True)
fit(X, y=None)

Learn the IDF vector (global term weights).

Parameters :

X: array, [n_samples, n_features] :

a matrix of term/token counts

transform(X)

Transform a count matrix to a TF or TF-IDF representation.

Parameters :

X: array, [n_samples, n_features] :

a matrix of term/token counts

Returns :

vectors: array, [n_samples, n_features] :