(T)
T = 0
    folder = 'trainT-0'
T = 0
    folder = 'trainT-0'
T = 0 folder = trainT - 0
def make(T):
    """
    T = 0
    folder = 'trainT-0'
    """
    if T==-1:
        folder = 'test'
    else:
        folder = 'trainT-'+str(T)
        
    log_ = log[log.order_number_rev>T]
    
    item = log_.groupby(['product_id', 'user_id']).size().reset_index()
    item.columns = ['product_id', 'user_id', 'cnt']
    
    item_one = item[item.cnt==1].groupby('product_id').size().reset_index()
    item_one.columns = ['product_id', 'item_only_one_user_cnt']
    
    item_size = item.groupby('product_id').size().reset_index()
    item_size.columns = ['product_id', 'item_unique_user']
    
    item = pd.merge(item_one, item_size, on='product_id', how='left')
    item['item_only_one_user_cnt_ratio'] = item['item_only_one_user_cnt']/item['item_unique_user']
    
    col = ['product_id', 'item_only_one_user_cnt', 'item_only_one_user_cnt_ratio']
    item[col].to_pickle('../feature/{}/f208_product.p'.format(folder))
def make ( T ) : if T == - 1 : folder = 'test' else : folder = 'trainT-' + str ( T ) log_ = log [ log . order_number_rev > T ] item = log_ . groupby ( [ 'product_id' , 'user_id' ] ) . size ( ) . reset_index ( ) item . columns = [ 'product_id' , 'user_id' , 'cnt' ] item_one = item [ item . cnt == 1 ] . groupby ( 'product_id' ) . size ( ) . reset_index ( ) item_one . columns = [ 'product_id' , 'item_only_one_user_cnt' ] item_size = item . groupby ( 'product_id' ) . size ( ) . reset_index ( ) item_size . columns = [ 'product_id' , 'item_unique_user' ] item = pd . merge ( item_one , item_size , on = 'product_id' , how = 'left' ) item [ 'item_only_one_user_cnt_ratio' ] = item [ 'item_only_one_user_cnt' ] / item [ 'item_unique_user' ] col = [ 'product_id' , 'item_only_one_user_cnt' , 'item_only_one_user_cnt_ratio' ] item [ col ] . to_pickle ( '../feature/{}/f208_product.p' . format ( folder ) )