我正在尝试使用 LDA 获取最大化类之间分离的功能子空间,但脚本引发了错误 ValueError: Negative values in data passed to LatentDirichletAllocation.fit
我不是不能用于负数据吗?或者有什么问题?我一直在寻找,但没有找到答案......
我正在尝试遍历初始化如下的 pytorch 数据加载器:
trainDL = torch.utils.data.DataLoader(X_train,batch_size=BATCH_SIZE,shuffle=True,**kwargs)
因此,我无法执行以下语句,因为我在“枚举”中收到 KeyError:
for batch_idx, (data, _) in enumerate(trainDL):
{stuff}
Run Code Online (Sandbox Code Playgroud)
有没有人知道发生了什么?
编辑:
我得到的错误是:
KeyError Traceback (most recent call last)
~/.local/share/virtualenvs/Pipenv-l_wD1rT4/lib/python3.6/site-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
2896 try:
-> 2897 return self._engine.get_loc(key)
2898 except KeyError:
pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()
pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()
KeyError: 40592
During handling of the above exception, another exception occurred:
KeyError Traceback (most recent call last)
<ipython-input-63-95142e0748bb> in <module>
----> 1 for batch_idx, (data, _) …Run Code Online (Sandbox Code Playgroud)