def persist(self, X, y, thesaurus):
"""
Save the data and the processed thesaurus.
Parameters
----------
X: sparse matrix
The train data: Will be compressed.
y: sparse matrix
The label data: Will be compressed.
thesaurus: ThesaurusReader
ThesaurusReader object: Will be pickled.
"""
print('Persisting features to disk')
self._delete_old_files()
self._save(self._persist_name('X'), X)
self._save(self._persist_name('y'), y)
with open(self._persist_name('TR'), mode='wb') as f:
pickle.dump(thesaurus, f)
评论列表
文章目录