📌  相关文章
📜  __init__() 得到了一个意外的关键字参数 'categorical_features' - 汇编代码示例

📅  最后修改于: 2022-03-11 14:48:10.528000             🧑  作者: Mango

代码示例1
from sklearn.preprocessing import LabelEncoder, OneHotEncoder
from sklearn.compose import ColumnTransformer

# Country column
ct = ColumnTransformer([("Country", OneHotEncoder(), [1])], remainder = 'passthrough')
X = ct.fit_transform(X)

# Male/Female
labelencoder_X = LabelEncoder()
X[:, 2] = labelencoder_X.fit_transform(X[:, 2])