首页 > 解决方案 > np.zeros(self.shape,dtype=self.dtype,order=order)

问题描述

这是我的代码:

    tfid_vectorizer = TfidfVectorizer("english")
    tfid_vectorizer.fit(data['Processed_Logs'].values.astype('U'))
    tfid_matrix=tfid_vectorizer.transform(data['Processed_Logs'].values.astype('U'))
    array=tfid_matrix.todense() #matrix in numpy array
   

将其拟合到 numpy 数组时出错:MemoryError: Unable to allocate 780. GiB for an array with shape (1866702, 56047)

标签: scikit-learnnlp

解决方案


推荐阅读