Пример #1
0
	def save_pmi_matrix(self, T, sub_folder, base_path=None):
		if (not os.path.exists(os.path.join(self.cache_path_, sub_folder))):
			os.makedirs(os.path.join(self.cache_path_, sub_folder))

		if (base_path is None):
			base_path = self.cache_path_
		utils.sparse_matrix_to_hdf(T, os.path.join(base_path, sub_folder), 'T.hdf')
Пример #2
0
	def save_cooccurrence_matrix(self, M, sub_folder):
		if (not os.path.exists(os.path.join(self.cache_path_, sub_folder))):
			os.makedirs(os.path.join(self.cache_path_, sub_folder))

		utils.sparse_matrix_to_hdf(M, os.path.join(self.cache_path_, sub_folder), 'M.hdf')