每次尝试使用scikit-learn
类时,我都遇到GradientBoostingRegressor
的问题,出现以下错误:
Traceback (most recent call last):
File "C:\Users\rober\Desktop\Privat\Roland_Manu_ProjektBeidl\numerai_datasets\testitest.py", line 11, in <module>
from sklearn.ensemble import GradientBoostingRegressor
File "C:\Users\rober\Anaconda3\lib\site-packages\sklearn\__init__.py", line 80, in <module>
from .base import clone
File "C:\Users\rober\Anaconda3\lib\site-packages\sklearn\base.py", line 21, in <module>
from .utils import _IS_32BIT
File "C:\Users\rober\Anaconda3\lib\site-packages\sklearn\utils\__init__.py", line 24, in <module>
from . import _joblib
File "C:\Users\rober\Anaconda3\lib\site-packages\sklearn\utils\_joblib.py", line 8, in <module>
from joblib import logger
ImportError: cannot import name 'logger' from 'joblib' (unknown location)
我的代码如下
import csv
import pandas as pd
import numpy as np
from sklearn.ensemble import GradientBoostingRegressor
model = GradientBoostingRegressor(learning_rate=0.01, n_estimators=100,
max_depth=5, validation_fraction=0.2, n_iter_no_change=10,
tol=1e-3)
有人可以帮助我吗?我尝试加载外部joblib
库,但未成功。
编辑:抱歉,现在显示了整个错误日志。
答案 0 :(得分:1)
尝试使用 Anaconda Prompt 重新安装 sklearn:
conda install -c anaconda scikit-learn