简体   繁体   中英

Sklearn error, cannot import name 'Logger' from 'joblib'

I am having problems with scikit-learn as everytime I try using the GradientBoostingRegressor class, I get the following error:

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)

My code looks as follows

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)

Can someone please help me? I have tried loading the external joblib library, but to no success.

EDIT: Sorry, the whole error log is shown now.

尝试使用 Anaconda Prompt 重新安装 sklearn:

conda install -c anaconda scikit-learn

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM