예제 #1
0
파일: 6_fe.py 프로젝트: jhyehuang/sex_age
def deviceid_package_start_close_train(deviceid, app_id='0'):
    sql = 'select * from deviceid_package_start_close where device_id=\"'
    sql = sql + deviceid + '\" '
    sql = sql + 'and app_id=\"'
    sql = sql + app_id + '\"'
    ret = data_from_mysql(sql)
    return ret
예제 #2
0
def augmentatio_deviceid_packages():
#    sql='alter table deviceid_train add n_class int(4) default 0'
#    ret=data_from_mysql(sql)
#    print(ret.head(3))
    sql='select * from deviceid_train'
    package_label=data_from_mysql(sql)
    deviceid_packages=pd.read_csv(file_path+'deviceid_packages.csv')
    cols=deviceid_packages.columns
    deviceid_packages=pd.merge(deviceid_packages,package_label,on=['device_id'],how='left')
    deviceid_packages=data_augmentation(deviceid_packages)
    logging.debug(deviceid_packages.shape)
    deviceid_packages.to_csv(file_path+'deviceid_packages.csv',columns=cols,index= False)
예제 #3
0
파일: 6_fe.py 프로젝트: jhyehuang/sex_age
def dev_id_train():
    sql = 'select * from deviceid_train'
    deviceid_train = data_from_mysql(sql)
    return deviceid_train
예제 #4
0
def deviceid_package_start_close_train(deviceid):
    sql = 'select * from deviceid_package_start_close where device_id=\"'
    sql = sql + deviceid + '\" '
    #    print(sql)
    ret = data_from_mysql(sql)
    return ret