英文:
ImportError: cannot import name '_check_weights' from 'sklearn.neighbors._base'
问题
I am trying to do Missforest as a method for handling missing values in table data.
我正在尝试使用Missforest作为处理表格数据中缺失值的方法。
import sklearn
print(sklearn.__version__)
# ->1.2.1
import sklearn.neighbors._base
import sys
sys.modules['sklearn.neighbors.base'] = sklearn.neighbors._base
!pip install missingpy
from missingpy import MissForest
It was working fine until now, but since yesterday, the following error message has appeared.
迄今为止它一直正常工作,但从昨天开始,出现了以下错误信息。
ImportError: cannot import name 'check_weights' from 'sklearn.neighbors._base'
I would like to know how to deal with this error.
我想知道如何处理这个错误。
英文:
I am trying to do Missforest as a method for handling missing values in table data.
import sklearn
print(sklearn.__version__)
->1.2.1
import sklearn.neighbors._base
import sys
sys.modules['sklearn.neighbors.base'] = sklearn.neighbors._base
!pip install missingpy
from missingpy import MissForest
It was working fine until now, but since yesterday, the following error message has appeared.
ImportError: cannot import name '_check_weights' from 'sklearn.neighbors._base'
I would like to know how to deal with this error.
答案1
得分: 2
相同的事情发生在我身上,我更改了包的版本。我有以下设置,它对我有效:scikit-learn = 1.1.2,scipy = 1.9.1,missingpy = 0.2.0。
英文:
the same thing happened to me, I changed the versions of the packages. I have the following setting and it works for me: scikit-learn = 1.1.2, scipy = 1.9.1, missingpy = 0.2.0.
答案2
得分: 0
你可以使用 pipwin
来安装适合你的操作系统和特定Python版本的构建:
步骤:
-
卸载当前版本的sklearn:
pip uninstall scikit-learn -y
-
安装pipwin:
pip install pipwin
-
使用pipwin安装sklearn:
pipwin install scikit-learn
英文:
You could use pipwin
to install the appropriate build for your operating system and specific Python version:
Steps:
-
Uninstall current version of sklearn:
pip uninstall scikit-learn -y
-
Install pipwin:
pip install pipwin
-
Install sklearn using pipwin:
pipwin install scikit-learn
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论