Mean encoding sklearn. preprocessing import LabelEncoder, OneHotEncoder X_str = np.