📌  相关文章
📜  missingpy 没有名为 'sklearn.neighbors.base' 的模块 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:11.882000             🧑  作者: Mango

代码示例1
# Thank you AMLoucas from https://gist.github.com/betterdatascience/c455473d7445c0e7e279efe31a896e17 !!
# Whoever is having the issue with ModuleNotFoundError: No module named 'sklearn.neighbors.base'. this is because when importing missingpy it tries to import automatically 'sklearn.neighbors.base' however in the new versions of sklearn it has been renamed to 'sklearn.neighbors._base' so we have to manually import it to work. The code snippet below does the job. You run the snippet before the import

"""""""""""""""""""""""""""
import sklearn.neighbors._base
sys.modules['sklearn.neighbors.base'] = sklearn.neighbors._base
"""""""""""""""""""""""""""