|
@@ -25,19 +25,19 @@ class CustConfig:
|
|
|
# 数据清洗规则
|
|
# 数据清洗规则
|
|
|
CLEANING_RULES = {
|
|
CLEANING_RULES = {
|
|
|
"BB_RTL_CUST_POSITION_TYPE_NAME": {"method": "fillna", "opt": "fill", "value": "其他", "type": "str"},
|
|
"BB_RTL_CUST_POSITION_TYPE_NAME": {"method": "fillna", "opt": "fill", "value": "其他", "type": "str"},
|
|
|
|
|
+ "BB_RTL_CUST_MARKET_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_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_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"},
|
|
# "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_RTL_CUST_CREDITCLASS_NAME": {"method": "fillna", "opt": "fill", "value": "未评价", "type": "str"},
|
|
|
# "MD04_MG_SAMPLE_CUST_FLAG": {"method": "fillna", "value": "N", "opt": "fill"},
|
|
# "MD04_MG_SAMPLE_CUST_FLAG": {"method": "fillna", "value": "N", "opt": "fill"},
|
|
|
# "MD07_RTL_CUST_IS_SALE_LARGE_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_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"},
|
|
|
|
|
|
|
+ "BB_RTL_CUST_CHAIN_FLAG": {"method": "fillna", "opt": "fill", "value": "否", "type": "str"},
|
|
|
|
|
+ "MD04_DIR_SAL_STORE_FLAG": {"method": "fillna", "opt": "fill", "value": "否", "type": "str"},
|
|
|
"STORE_AREA": {"method": "fillna", "opt": "mean", "type": "num"},
|
|
"STORE_AREA": {"method": "fillna", "opt": "mean", "type": "num"},
|
|
|
"OPERATOR_AGE": {"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"},
|
|
|
|
|
|
|
+ "OPERATOR_EDU_LEVEL": {"method": "fillna", "opt": "fill", "value": "01", "type": "str"},
|
|
|
}
|
|
}
|
|
|
# one-hot编码
|
|
# one-hot编码
|
|
|
ONEHOT = [
|
|
ONEHOT = [
|
|
@@ -50,6 +50,20 @@ class CustConfig:
|
|
|
"OPERATOR_EDU_LEVEL",
|
|
"OPERATOR_EDU_LEVEL",
|
|
|
]
|
|
]
|
|
|
|
|
|
|
|
|
|
+ ONEHOT_CAT = {
|
|
|
|
|
+ "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": [1, 2, 3, 4, 5, 6, 7]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
class ProductConfig:
|
|
class ProductConfig:
|
|
|
FEATURE_COLUMNS = [
|
|
FEATURE_COLUMNS = [
|
|
|
"product_code", # 商品编码
|
|
"product_code", # 商品编码
|
|
@@ -93,7 +107,7 @@ class ProductConfig:
|
|
|
"allot_price": {"method": "fillna", "opt": "fill", "type": "num", "value": 0.0},
|
|
"allot_price": {"method": "fillna", "opt": "fill", "type": "num", "value": 0.0},
|
|
|
"direct_whole_price": {"method": "fillna", "opt": "mean", "type": "num"},
|
|
"direct_whole_price": {"method": "fillna", "opt": "mean", "type": "num"},
|
|
|
"retail_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": "其他"},
|
|
|
|
|
|
|
+ "price_type_name": {"method": "fillna", "opt": "fill", "type": "str", "value": "一类烟"},
|
|
|
"gear_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": "其他"},
|
|
"category_type_name": {"method": "fillna", "opt": "fill", "type": "str", "value": "其他"},
|
|
|
"is_key_brand": {"method": "fillna", "opt": "fill", "type": "str", "value": "否"},
|
|
"is_key_brand": {"method": "fillna", "opt": "fill", "type": "str", "value": "否"},
|
|
@@ -113,7 +127,7 @@ class ProductConfig:
|
|
|
"tar_qty": {"method": "fillna", "opt": "mean", "type": "num"},
|
|
"tar_qty": {"method": "fillna", "opt": "mean", "type": "num"},
|
|
|
"product_style_code_name": {"method": "fillna", "opt": "fill", "type": "str", "value": "其他"},
|
|
"product_style_code_name": {"method": "fillna", "opt": "fill", "type": "str", "value": "其他"},
|
|
|
"chinese_mix": {"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": "其他"},
|
|
|
|
|
|
|
+ "sub_price_type_name": {"method": "fillna", "opt": "fill", "type": "str", "value": "普一类烟"},
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
ONEHOT = [
|
|
ONEHOT = [
|
|
@@ -137,4 +151,27 @@ class ProductConfig:
|
|
|
"product_style_code_name", # 包装类型名称
|
|
"product_style_code_name", # 包装类型名称
|
|
|
"chinese_mix", # 中式混合
|
|
"chinese_mix", # 中式混合
|
|
|
"sub_price_type_name", # 细分卷烟价类名称
|
|
"sub_price_type_name", # 细分卷烟价类名称
|
|
|
- ]
|
|
|
|
|
|
|
+ ]
|
|
|
|
|
+ ONEHOT_CAT = {
|
|
|
|
|
+ "price_type_name": ["一类烟", "二类烟", "三类烟", "四类烟", "五类烟", "无价类"],
|
|
|
|
|
+ "gear_type_name": ["第一档位", "第二档位", "第三档位", "第四档位", "第五档位", "第六档位", "第七档位", "第八档位", "其他"],
|
|
|
|
|
+ "category_type_name": ["第1品类", "第2品类", "第3品类", "第4品类", "第5品类", "第6品类", "第7品类",
|
|
|
|
|
+ "第8品类", "第9品类", "第10品类", "第11品类", "第12品类", "第13品类", "其他"],
|
|
|
|
|
+ "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": ["高端烟", "高价位烟", "普一类烟", "二类烟", "三类烟", "四类烟", "五类烟", "无价类"],
|
|
|
|
|
+ }
|