Robert Reichel
Robert Reichel

Reputation: 11

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.

Upvotes: 1

Views: 2743

Answers (1)

Ktos
Ktos

Reputation: 75

Try re-installing sklearn by using Anaconda Prompt:

conda install -c anaconda scikit-learn

Upvotes: 2

Related Questions