Skip to main content
added 12 characters in body
Source Link
Siong Thye Goh
  • 3.2k
  • 2
  • 18
  • 23

In OneHotEncoder, use the parameter handle_unknown, it should look something like this, and now onehotencoder is auto on the dataset X, so you can remove the categorical_features or instead keep auto, removing it will solve the error:

onehotencoder = OneHotEncoder(categorical_features=[i], handle_unknown='ignore')

onehotencoder = OneHotEncoder(handle_unknown='ignore')

onehotencoder = OneHotEncoder(categorical_features=[i], handle_unknown='ignore') onehotencoder = OneHotEncoder(handle_unknown='ignore') 

Thanks.

In OneHotEncoder, use the parameter handle_unknown, it should look something like this, and now onehotencoder is auto on the dataset X, so you can remove the categorical_features or instead keep auto, removing it will solve the error:

onehotencoder = OneHotEncoder(categorical_features=[i], handle_unknown='ignore')

onehotencoder = OneHotEncoder(handle_unknown='ignore')

Thanks.

In OneHotEncoder, use the parameter handle_unknown, it should look something like this, and now onehotencoder is auto on the dataset X, so you can remove the categorical_features or instead keep auto, removing it will solve the error:

onehotencoder = OneHotEncoder(categorical_features=[i], handle_unknown='ignore') onehotencoder = OneHotEncoder(handle_unknown='ignore') 

Thanks.

added 207 characters in body
Source Link

In OneHotEncoder, use the parameter handle_unknown, it should look something like this, and now onehotencoder is auto on the dataset X, so you can remove the categorical_features or instead keep auto, removing it will solve the error: onehotencoder

onehotencoder = OneHotEncoder(categorical_features=[i], handle_unknown='ignore')

onehotencoder = OneHotEncoder(handle_unknown='ignore')

Thanks.

In OneHotEncoder, use the parameter handle_unknown, it should look something like this: onehotencoder = OneHotEncoder(categorical_features=[i], handle_unknown='ignore')

Thanks.

In OneHotEncoder, use the parameter handle_unknown, it should look something like this, and now onehotencoder is auto on the dataset X, so you can remove the categorical_features or instead keep auto, removing it will solve the error:

onehotencoder = OneHotEncoder(categorical_features=[i], handle_unknown='ignore')

onehotencoder = OneHotEncoder(handle_unknown='ignore')

Thanks.

Source Link

In OneHotEncoder, use the parameter handle_unknown, it should look something like this: onehotencoder = OneHotEncoder(categorical_features=[i], handle_unknown='ignore')

Thanks.