I am getting an error while importing OneHotEncoder in python. I have restarted the kernel and even installed the latest version of sklearn but still get the error. There is not much info available on this particular type of error. Please help.
from feature_engine.encoding import OneHotEncoder
Here is the error I get
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-3-90a9b526066c> in <module>
4 from sklearn.model_selection import train_test_split
5 #from feature_engine.encoding import OneHotEncoder
---> 6 from feature_engine.encoding import OneHotEncoder
~anaconda3libsite-packagesfeature_engineencoding\__init__.py in <module>
3 """
4
----> 5 from .count_frequency import CountFrequencyEncoder
6 from .decision_tree import DecisionTreeEncoder
7 from .mean_encoding import MeanEncoder
~anaconda3libsite-packagesfeature_engineencodingcount_frequency.py in <module>
25 )
26 from feature_engine._docstrings.substitute import Substitution
---> 27 from feature_engine.dataframe_checks import check_X
28 from feature_engine.encoding._helper_functions import check_parameter_unseen
29 from feature_engine.encoding.base_encoder import (
~anaconda3libsite-packagesfeature_enginedataframe_checks.py in <module>
8 import pandas as pd
9 from scipy.sparse import issparse
---> 10 from sklearn.utils.validation import _check_y, check_consistent_length
11
12
ImportError: cannot import name _check_y from sklearn.utils.validation
(C:Usersmintsanaconda3libsite-packagessklearnutilsvalidation.py)