用于实现自组织映射的库 sompy

Library sompy for implementing self-organizing maps

我已经安装了 sompy 库,但是当我导入它时出现下一个错误:

  import sompy
  
  ImportErrorTraceback (most recent call last)
  <ipython-input-86-97d518356b3c> in <module>
  ----> 1 import sompy

  /opt/conda/lib/python3.8/site-packages/sompy/__init__.py in <module>
  1 
  ----> 2 from sompy import SOM

  ImportError: cannot import name 'SOM' from partially initialized module 'sompy' (most likely due to a circular import) (/opt/conda/lib/python3.8/site-packages/sompy/__init__.py)

此问题已解释here。解决办法是安装更新版本的sompy:

pip3 install git+https://github.com/compmonks/SOMPY.git

还有其他更新的 SOM 包可用,例如 minisom and susi