Specifying the order of encoding in Ordinal Encoder
I had the same problem. This is bug in scikit-learn, already fixed and added to version 0.20.1, which is still not released. https://github.com/scikit-learn/scikit-learn/issues/12365
I solved it temporarily by copying fixed _encoders.py
to my project and using.
from _encoders import OrdinalEncoder