利用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
你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答
本次提问扣除的有问必答次数,将会以问答VIP体验卡(1次有问必答机会、商城购买实体图书享受95折优惠)的形式为您补发到账户。
因为有问必答VIP体验卡有效期仅有1天,您在需要使用的时候【私信】联系我,我会为您补发。