hugh116 2022-02-22 14:57 采纳率: 0%
浏览 9
已结题

featuretools做特征衍生运行出现这个

问题遇到的现象和发生背景

利用home-credit数据,做特征衍生,

from woodwork.logical_types import Boolean,Ordinal

def bool_type(df):

    col_type = {}

    for col in df:
        # If column is a number with only two values, encode it as a Boolean
        if (df[col].dtype != 'object') and (len(df[col].unique()) <= 2):
            col_type[col] = Boolean

    print('Number of boolean variables: ', len(col_type))
    return col_type
train_col_type = bool_type(application_train_new)

train_col_type['REGION_RATING_CLIENT'] = Ordinal
train_col_type['REGION_RATING_CLIENT_W_CITY'] = Ordinal
es = ft.EntitySet(id = 'clients')
es = es.add_dataframe(dataframe_name = 'app', dataframe = application_train_new, 
                              index = 'SK_ID_CURR',     
                              logical_types=train_col_type,) 

TypeError: Must use an Ordinal instance with order values defined

大概是有个顺序特征的设置不对,不知道咋设置,请教
  • 写回答

1条回答 默认 最新

  • 有问必答小助手 2022-02-24 09:58
    关注

    你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答


    本次提问扣除的有问必答次数,将会以问答VIP体验卡(1次有问必答机会、商城购买实体图书享受95折优惠)的形式为您补发到账户。


    因为有问必答VIP体验卡有效期仅有1天,您在需要使用的时候【私信】联系我,我会为您补发。

    评论

报告相同问题?

问题事件

  • 系统已结题 3月2日
  • 创建了问题 2月22日

悬赏问题

  • ¥15 我这模型写的不对吗?为什么lingo解出来的下面影子价格这一溜少一个变量
  • ¥50 树莓派安卓APK系统签名
  • ¥15 maple软件,用solve求反函数出现rootof,怎么办?
  • ¥65 汇编语言除法溢出问题
  • ¥15 Visual Studio问题
  • ¥20 求一个html代码,有偿
  • ¥100 关于使用MATLAB中copularnd函数的问题
  • ¥20 在虚拟机的pycharm上
  • ¥15 jupyterthemes 设置完毕后没有效果
  • ¥15 matlab图像高斯低通滤波