Skip to content

Instantly share code, notes, and snippets.

@bllchmbrs
Created December 8, 2015 20:51
Show Gist options
  • Save bllchmbrs/349b2526a0e4fd869c88 to your computer and use it in GitHub Desktop.
Save bllchmbrs/349b2526a0e4fd869c88 to your computer and use it in GitHub Desktop.
temp.py
# coding: utf-8
import loader
import pickle
from sklearn.feature_extraction.text import TfidfVectorizer
x = loader.load_xy2()
with open('temp.pkl', 'wb') as f:
pickle.dump(x, f)
t = TfidfVectorizer(use_idf=False)
z = [' '.join(q) for q in x[0]]
x_mtx = t.fit_transform(z)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment