0

My Goal is to avoid the warning message below

What I did

house_data = pd.read_csv('datasets/house_data_processed.csv')
target = house_data['price']
features = house_data.drop('price', axis=1)
features.columns
from yellowbrick.target import FeatureCorrelation
feature_names = list(features.columns)

Warning Msg

/Users/georgeng/opt/anaconda3/lib/python3.7/site-packages/sklearn/utils/deprecation.py:144 FutureWarning: The sklearn.metrics.classification module is deprecated in version 0.22 and will be removed in version 0.24. The corresponding classes / functions should instead be imported from sklearn.metrics. Anything that cannot be imported from sklearn.metrics is now part of the private API. warnings.warn(message, FutureWarning)

Question - I didn't use sklearn in the offending statement above why would the warning msg implied I used sklearn.metrics.classification?

Thnks for your help. George

Venkatachalam
  • 16,288
  • 9
  • 49
  • 77
George Ng
  • 51
  • 2
  • 7
  • Are you sure you copied your code snippet correctly, When I run it, I'm getting a syntax error. I would also recommend adding sklearn to your tags. – WyattBlue May 23 '20 at 06:14
  • @WyattBlue thanks for your comment. I've corrected the code and added sklearn to my tag. – George Ng May 23 '20 at 07:17
  • `yellowbrick` uses `sklearn`. You can send this problem to author of `yellowbrick` and ask him to change code. Python has also module `warnings` to control which warning will be displayed but you would have to use `Google` to find details. – furas May 23 '20 at 07:54

1 Answers1

0

You don't use sklearn directly but yellowbrick uses it.

Run only this line to see it

 from yellowbrick.target import FeatureCorrelation

Send this problem to yelolowbrick author and ask him to change code.

At this moment you can use module warnings to filter warnings

import warnings
warnings.simplefilter("ignore")

from yellowbrick.target import FeatureCorrelation
furas
  • 134,197
  • 12
  • 106
  • 148