class CustConfig: FEATURE_COLUMNS = [ "BB_RETAIL_CUSTOMER_CODE", # 零售户代码 "BB_RTL_CUST_POSITION_TYPE_NAME", # 零售户商圈类型名称 "BB_RTL_CUST_MARKET_TYPE_NAME", # 零售户市场类型名称 # "BB_RTL_CUST_BUSINESS_TYPE_NAME", # 零售户业态名称 "BB_RTL_CUST_SUB_BUSI_PLACE_NAME", # 零售户业态细分名称 "BB_RTL_CUST_GRADE_NAME", # 零售户分档名称 # "BB_RTL_CUST_TERMINAL_LEVEL_NAME", # 零售户终端层级名称 # "BB_RTL_CUST_TERMINALEVEL_NAME", # 零售户终端层级细分名称 # "MD04_MG_RTL_CUST_CREDITCLASS_NAME", # 零售户信用等级名称 # "MD04_MG_SAMPLE_CUST_FLAG", # 样本户标识 # "MD07_RTL_CUST_IS_SALE_LARGE_FLAG", # 零售户大户标识 # "BB_CUSTOMER_MANAGER_SCOPE_NAME", # 零售户经营范围名称 # "BB_RTL_CUST_OPERATE_METHOD_NAME", # 零售户经营方式名称 # "BB_RTL_CUST_CGT_OPERATE_SCOPE_NAME", # 零售户卷烟经营规模名称 "BB_RTL_CUST_CHAIN_FLAG", # 零售户连锁标识 "MD04_DIR_SAL_STORE_FLAG", # 直营店标识 "STORE_AREA", # 店铺经营面积 "OPERATOR_AGE", # 经营者年龄 "OPERATOR_EDU_LEVEL", # 零售客户经营者文化程 # "AVERAGE_CONSUMER_FLOW", # 月均消费人流 # "NEW_PRODUCT_MEMBERS_QTY", # 新品消费会员数量 ] # 数据清洗规则 CLEANING_RULES = { "BB_RTL_CUST_POSITION_TYPE_NAME": {"method": "fillna", "opt": "fill", "value": "其他", "type": "str"}, "BB_RTL_CUST_SUB_BUSI_PLACE_NAME": {"method": "fillna", "opt": "fill", "value": "其他", "type": "str"}, "BB_RTL_CUST_GRADE_NAME": {"method": "fillna", "opt": "fill", "value": "其他", "type": "str"}, # "BB_RTL_CUST_TERMINALEVEL_NAME": {"method": "fillna", "opt": "replace", "value": "BB_RTL_CUST_TERMINAL_LEVEL_NAME", "type": "str"}, # "MD04_MG_RTL_CUST_CREDITCLASS_NAME": {"method": "fillna", "opt": "fill", "value": "未评价", "type": "str"}, # "MD04_MG_SAMPLE_CUST_FLAG": {"method": "fillna", "value": "N", "opt": "fill"}, # "MD07_RTL_CUST_IS_SALE_LARGE_FLAG": {"method": "fillna", "value": "N", "opt": "fill"}, "BB_RTL_CUST_CHAIN_FLAG": {"type": "fillna", "opt": "fill", "value": "0", "type": "str"}, # "BB_RTL_CUST_CGT_OPERATE_SCOPE_NAME": {"method": "fillna", "value": "中", "opt": "fill"}, "BB_RTL_CUST_CHAIN_FLAG": {"method": "fillna", "opt": "fill", "value": "0", "type": "str"}, "MD04_DIR_SAL_STORE_FLAG": {"method": "fillna", "opt": "fill", "value": "0", "type": "str"}, "STORE_AREA": {"method": "fillna", "opt": "mean", "type": "num"}, "OPERATOR_AGE": {"method": "fillna", "opt": "mean", "type": "num"}, "OPERATOR_EDU_LEVEL": {"method": "fillna", "opt": "fill", "value": "00", "type": "str"}, } # one-hot编码 ONEHOT = [ "BB_RTL_CUST_POSITION_TYPE_NAME", "BB_RTL_CUST_MARKET_TYPE_NAME", "BB_RTL_CUST_SUB_BUSI_PLACE_NAME", "BB_RTL_CUST_GRADE_NAME", "BB_RTL_CUST_CHAIN_FLAG", "MD04_DIR_SAL_STORE_FLAG", "OPERATOR_EDU_LEVEL", ] class ProductConfig: FEATURE_COLUMNS = [ "product_code", # 商品编码 # "factory_name", # 工业公司名称 # "brand_code", # 品牌编码 "adjust_price", # 含税调拨价 "notwithtax_adjust_price", # 不含税调拨价 "whole_sale_price", # 统一批发价 "direct_retail_price", # 建议零售价 "allot_price", # 调拨价 "direct_whole_price", # 批发指导价 "retail_price", # 零售价 "price_type_name", # 卷烟价类名称 "gear_type_name", # 卷烟档位名称 "category_type_name", # 卷烟品类名称 "is_key_brand", # 是否重点品牌 "is_high_level", # 是否高端烟 "is_upscale_level", # 是否高端烟不含高价 "is_high_price", # 是否高价烟 "is_low_price", # 是否低价烟 "is_low_tar", # 是否低焦油烟 "is_encourage", # 是否全国鼓励品牌 "is_abnormity", # 是否异形包装 "is_intake", # 是否进口烟 "is_short", # 是否紧俏品牌 "is_medium", # 是否中支烟 "is_shortbranch", # 是否短支烟 "is_ordinary_price_type", # 是否普一类烟 "source_type", # 来源类型 "tar_qty", # 焦油含量 "product_style_code_name", # 包装类型名称 "chinese_mix", # 中式混合 "sub_price_type_name", # 细分卷烟价类名称 ] CLEANING_RULES = { "adjust_price": {"method": "fillna", "opt": "mean", "type": "num"}, "notwithtax_adjust_price": {"method": "fillna", "opt": "mean", "type": "num"}, "whole_sale_price": {"method": "fillna", "opt": "mean", "type": "num"}, "direct_retail_price": {"method": "fillna", "opt": "mean", "type": "num"}, "allot_price": {"method": "fillna", "opt": "fill", "type": "num", "value": 0.0}, "direct_whole_price": {"method": "fillna", "opt": "mean", "type": "num"}, "retail_price": {"method": "fillna", "opt": "mean", "type": "num"}, "price_type_name": {"method": "fillna", "opt": "fill", "type": "str", "value": "其他"}, "gear_type_name": {"method": "fillna", "opt": "fill", "type": "str", "value": "其他"}, "category_type_name": {"method": "fillna", "opt": "fill", "type": "str", "value": "其他"}, "is_key_brand": {"method": "fillna", "opt": "fill", "type": "str", "value": "否"}, "is_high_level": {"method": "fillna", "opt": "fill", "type": "str", "value": "否"}, "is_upscale_level": {"method": "fillna", "opt": "fill", "type": "str", "value": "否"}, "is_high_price": {"method": "fillna", "opt": "fill", "type": "str", "value": "否"}, "is_low_price": {"method": "fillna", "opt": "fill", "type": "str", "value": "否"}, "is_low_tar": {"method": "fillna", "opt": "fill", "type": "str", "value": "否"}, "is_encourage": {"method": "fillna", "opt": "fill", "type": "str", "value": "否"}, "is_abnormity": {"method": "fillna", "opt": "fill", "type": "str", "value": "否"}, "is_intake": {"method": "fillna", "opt": "fill", "type": "str", "value": "否"}, "is_short": {"method": "fillna", "opt": "fill", "type": "str", "value": "否"}, "is_medium": {"method": "fillna", "opt": "fill", "type": "str", "value": "否"}, "is_shortbranch": {"method": "fillna", "opt": "fill", "type": "str", "value": "否"}, "is_ordinary_price_type": {"method": "fillna", "opt": "fill", "type": "str", "value": "否"}, "source_type": {"method": "fillna", "opt": "fill", "type": "str", "value": "其他"}, "tar_qty": {"method": "fillna", "opt": "mean", "type": "num"}, "product_style_code_name": {"method": "fillna", "opt": "fill", "type": "str", "value": "其他"}, "chinese_mix": {"method": "fillna", "opt": "fill", "type": "str", "value": "否"}, "sub_price_type_name": {"method": "fillna", "opt": "fill", "type": "str", "value": "其他"}, } ONEHOT = [ "price_type_name", # 卷烟价类名称 "gear_type_name", # 卷烟档位名称 "category_type_name", # 卷烟品类名称 "is_key_brand", # 是否重点品牌 "is_high_level", # 是否高端烟 "is_upscale_level", # 是否高端烟不含高价 "is_high_price", # 是否高价烟 "is_low_price", # 是否低价烟 "is_low_tar", # 是否低焦油烟 "is_encourage", # 是否全国鼓励品牌 "is_abnormity", # 是否异形包装 "is_intake", # 是否进口烟 "is_short", # 是否紧俏品牌 "is_medium", # 是否中支烟 "is_shortbranch", # 是否短支烟 "is_ordinary_price_type", # 是否普一类烟 "source_type", # 来源类型 "product_style_code_name", # 包装类型名称 "chinese_mix", # 中式混合 "sub_price_type_name", # 细分卷烟价类名称 ]