scikit-learn - 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)
解决方案
推荐阅读
- mysql - 一般错误:1114 表 '/var/db/mysql_tmpdir/#sql3cac_5b34d_1' 已满 - Magento 2.4.2
- list - Flutter: Remove item for a list reflect another list
- reactjs - ReactJS 路由器未在 URL 中显示页面名称
- kotlin - 通用 JPA 转换器在运行时不知道类型
- node.js - 迁移到 webpack 5:无法读取未定义的属性“原型”
- r - R如何分隔基于字符串的空格但保留小数点?
- javascript - 在 Javascript 中将对象设置为 null 时是否会删除事件侦听器?
- haskell - Haskell中括号内的双点是什么意思?
- ios - Swift 5 中不显示导航栏
- spring - 保存 ThreadPoolExecutor 的所有排队任务