DistrictDataLabs / yellowbrick

Visual analysis and diagnostic tools to facilitate machine learning model selection.
http://www.scikit-yb.org/
Apache License 2.0
4.29k stars 559 forks source link

ImportError: cannot import name '_print_elapsed_time' #863

Closed rjalexa closed 5 years ago

rjalexa commented 5 years ago

I am copying the def visual_model_selection(X, y, estimator) sample into a Jupiter lab notebook and get the error as in the title:

ImportError: cannot import name '_print_elapsed_time'

I have the following imports before it:

import pandas as pd
import numpy as np

# data science libraries
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.linear_model import RidgeCV, LassoCV, Ridge, Lasso
from sklearn.linear_model import LogisticRegressionCV, LogisticRegression, SGDClassifier,LinearRegression
from sklearn.neighbors import KNeighborsClassifier
from sklearn.tree import DecisionTreeClassifier
from sklearn.naive_bayes import GaussianNB
from sklearn.svm import LinearSVC, NuSVC, SVC
from sklearn.ensemble import BaggingClassifier, ExtraTreesClassifier, RandomForestClassifier

from sklearn.metrics import f1_score

from sklearn.model_selection import train_test_split

from sklearn import preprocessing

# utility libraries
import warnings; warnings.simplefilter('ignore')

Desktop (please complete the following information):

iMac:~ bob$ pip3 install -U yellowbrick Requirement already up-to-date: yellowbrick in ./miniconda3/lib/python3.6/site-packages (0.9.1) Requirement already satisfied, skipping upgrade: cycler>=0.10.0 in ./miniconda3/lib/python3.6/site-packages (from yellowbrick) (0.10.0) Requirement already satisfied, skipping upgrade: matplotlib!=3.0.0,>=1.5.1 in ./miniconda3/lib/python3.6/site-packages (from yellowbrick) (3.1.0) Requirement already satisfied, skipping upgrade: numpy>=1.13.0 in ./miniconda3/lib/python3.6/site-packages (from yellowbrick) (1.14.5) Requirement already satisfied, skipping upgrade: scipy>=1.0.0 in ./miniconda3/lib/python3.6/site-packages (from yellowbrick) (1.1.0) Requirement already satisfied, skipping upgrade: scikit-learn>=0.20 in ./miniconda3/lib/python3.6/site-packages (from yellowbrick) (0.21.2) Requirement already satisfied, skipping upgrade: six in ./miniconda3/lib/python3.6/site-packages (from cycler>=0.10.0->yellowbrick) (1.11.0) Requirement already satisfied, skipping upgrade: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in ./miniconda3/lib/python3.6/site-packages (from matplotlib!=3.0.0,>=1.5.1->yellowbrick) (2.2.0) Requirement already satisfied, skipping upgrade: kiwisolver>=1.0.1 in ./miniconda3/lib/python3.6/site-packages (from matplotlib!=3.0.0,>=1.5.1->yellowbrick) (1.0.1) Requirement already satisfied, skipping upgrade: python-dateutil>=2.1 in ./miniconda3/lib/python3.6/site-packages (from matplotlib!=3.0.0,>=1.5.1->yellowbrick) (2.7.3) Requirement already satisfied, skipping upgrade: joblib>=0.11 in ./miniconda3/lib/python3.6/site-packages (from scikit-learn>=0.20->yellowbrick) (0.13.2) Requirement already satisfied, skipping upgrade: setuptools in ./miniconda3/lib/python3.6/site-packages (from kiwisolver>=1.0.1->matplotlib!=3.0.0,>=1.5.1->yellowbrick) (39.2.0)

rjalexa commented 5 years ago

Sorry I am confused the error just went away without myself understanding why it came and why it went :(

ndanielsen commented 5 years ago

@rjalexa Thanks for checking out yellowbrick. Sorry to hear that an error popped up but then seemed to resolve itself - which I'm happy to hear.

Thank you for your detailed write up. It is very helpful to track these types of issues where it can potentially be happening to other uses.

Thanks again!

bb324930 commented 5 years ago

I am also seeing this issue. Have tried installing older versions of yellowbrick, but to no avail.