简体   繁体   English

我已经安装了 scikit-learn/sklearn。 运行 python 文件后出现此错误

[英]I have installed scikit-learm/sklearn. After running the python file this error is coming

Scanning for .csv files in folder `Dataset`...

===> File to be labeled: SampleDataset.csv

-------> Generating reports based on the trained models...

---------------> Generating report based on classifier `Davidson` trained on dataset `Davidson`.

Traceback (most recent call last):
  File "Classifiers/Davidson/DavidsonClassifier.py", line 334, in <module>
    test(args)
  File "Classifiers/Davidson/DavidsonClassifier.py", line 316, in test
    y_preds = loaded_model.predict(X)
  File "/home/root1/Desktop/btp/OnlineHarms-Metatool/newenv/lib/python3.8/site-packages/sklearn/utils/metaestimators.py", line 120, in <lambda>
    out = lambda *args, **kwargs: self.fn(obj, *args, **kwargs)
  File "/home/root1/Desktop/btp/OnlineHarms-Metatool/newenv/lib/python3.8/site-packages/sklearn/pipeline.py", line 418, in predict
    Xt = transform.transform(Xt)
  File "/home/root1/Desktop/btp/OnlineHarms-Metatool/newenv/lib/python3.8/site-packages/sklearn/feature_selection/_base.py", line 88, in transform
    mask = self.get_support()
  File "/home/root1/Desktop/btp/OnlineHarms-Metatool/newenv/lib/python3.8/site-packages/sklearn/feature_selection/_base.py", line 52, in get_support
    mask = self._get_support_mask()
  File "/home/root1/Desktop/btp/OnlineHarms-Metatool/newenv/lib/python3.8/site-packages/sklearn/feature_selection/_from_model.py", line 189, in _get_support_mask
    estimator=estimator, getter=self.importance_getter,
AttributeError: 'SelectFromModel' object has no attribute 'importance_getter'
---------------> Generating report based on classifier `Davidson` trained on dataset `Founta`.

Is there some package that is missing or is it a version error?是否有一些 package 丢失或版本错误?


Here is a github repo link of ml model:- https://github.com/yashnatani28/OnlineHarms-Metatool这是 ml model 的 github 回购链接:- https://github.com/yashnatani28/OnlineHarms-Metatool

I had this error as well, and in your case as well it's most likely due to a version mismatch.我也有这个错误,在你的情况下,这很可能是由于版本不匹配。 try reinstalling scikit-learn with pip install scikit-learn --upgrade (or fix the version you want, but greater than 0.24 – importance_getter is an attribute introduced in version 0.24).尝试使用 pip 重新安装scikit-learn pip install scikit-learn --upgrade (或修复您想要的版本,但大于 0.24 importance_getter是版本 0.24 中引入的属性)。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Python sklearn。 为什么我第一次收到警告? - Python sklearn. Why I received warnings first time only? python sklearn 中的导入错误。 无法加载引用的库 - Import error in python sklearn. Cannot load referenced library 带有 python 和 sklearn 的 jupyter 笔记本。 精度分数误差 - jupyter notebook with python and sklearn. precision score error python scikit错误-没有名为sklearn的模块 - python scikit error - no module named sklearn 我更新了scikit.learn,但仍然收到此错误:ModuleNotFoundError:没有名为“ sklearn.cross_validation”的模块 - I updated scikit.learn but I have still get this error: ModuleNotFoundError: No module named 'sklearn.cross_validation' 我尝试在 mac os 终端中运行我的 python 程序,但在我成功安装 Beautifulsoup4 后不断收到以下反馈 - I tried running my python program in a mac os terminal but keep getting the feedback below after I have successfully installed Beautifulsoup4 学习。 导入错误:DLL 加载失败 - sklearn. ImportError: DLL load failed Sklearn 中的 fit 方法。 使用 KNeighborsClassifier 时 - fit method in Sklearn. when using KNeighborsClassifier 安装了Python 3,运行时出错 - Python 3 installed, error when running 我在 spyder ImportError: cannot import name 'six' from 'sklearn.externals' 尽管我已经安装了六个模块 - i got this error on spyder ImportError: cannot import name 'six' from 'sklearn.externals' despite i have installed the six module
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM