Skip to content

Hashing with HashingVectorizer #36

@imsanjoykb

Description

@imsanjoykb

from sklearn.feature_extraction.text import HashingVectorizer

list of text documents

text = ["The quick brown fox jumped over the lazy dog."]

create the transform

vectorizer = HashingVectorizer(n_features=20)

encode document

vector = vectorizer.transform(text)

summarize encoded vector

print(vector.shape)
print(vector.toarray())

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions