【问题标题】:Get feature names from ColumnTransformer after OHE and scaling在 OHE 和缩放之后从 ColumnTransformer 获取特征名称
【发布时间】:2021-11-19 14:43:38
【问题描述】:

如何从

获取我的功能名称列表
ct = ColumnTransformer([
    ("onehot", OneHotEncoder(sparse=False, handle_unknown='ignore'), cat_features),
    ("scaler", MinMaxScaler(), num_features)],
    remainder='passthrough')

【问题讨论】:

    标签: scikit-learn data-preprocessing


    【解决方案1】:

    您可以使用encoded_feat = ct.get_feature_names_out()返回功能名称

    【讨论】:

      猜你喜欢
      • 2019-07-05
      • 2021-08-05
      • 1970-01-01
      • 2018-09-01
      • 2017-06-03
      • 2019-06-30
      • 2017-02-10
      • 2017-04-23
      • 2016-11-01
      相关资源
      最近更新 更多