Beispiel #1
0
 def __init__(self):
     self.data_dir = 'E:\\gitshell\\tianchi2'
     # 词组
     self.word_num = 0
     self.dict_word = {}
     self.top_k_word = 20000  # 详细计算前20000的词组
     self.word_M = np.zeros((1000000, 2))  # 第一列 记录word_id  第二列 记录 概率对数
     self.word_item_array = [""] * 1000000  # 每个词被哪些商品使用
     self.word_word = np.zeros((3, 3))
     # 需要预测的词组
     self.r_word_num = 0
     self.r_dict_word = {}
     self.r_word_M = np.zeros((80000, 2))
     self.test_item = []
     # 商品
     self.dict_item = {}
     self.item_M = np.zeros((600000, 2), int)  # item_id  类别编号
     self.item_word_array = [""] * 600000
     self.item_num = 0
     # 类别
     self.class_M = np.zeros((3000000, 2))  # 类别id  类别商品计数/ 概率对数
     self.dict_class = {}
     self.class_num = 0
     self.class_class = np.zeros((2, 2))
     # 原始人工经验
     self.exp_peo = exp_of_people()
     self.exp_peo.read_jingyan()
     # self.matrix_item = np.zeros((10000000,3))
     # 概率优化模块
     self.pro_guji = Pro_estimate()
     # 只考虑 最热的 6万 商品
     self.item_top_k = 60000
     # 原始的搭配概率
     self.p_match = 0.0006  # 任意随机商品 搭配的概率
     pass
Beispiel #2
0
 def __init__(self):
     self.data_dir = 'E:\\gitshell\\tianchi2'
     # 词组
     self.word_num = 0
     self.dict_word = {}
     self.top_k_word = 20000  # 详细计算前20000的词组
     self.word_M = np.zeros((1000000, 2))  # 第一列 记录word_id  第二列 记录 概率对数
     self.word_item_array = [""] * 1000000  # 每个词被哪些商品使用
     self.word_word = np.zeros((3, 3))
     # 需要预测的词组
     self.r_word_num = 0
     self.r_dict_word = {}
     self.r_word_M = np.zeros((80000, 2))
     self.test_item = []
     # 商品
     self.dict_item = {}
     self.item_M = np.zeros((600000, 2), int)  # item_id  类别编号
     self.item_word_array = [""] * 600000
     self.item_num = 0
     # 类别
     self.class_M = np.zeros((3000000, 2))  # 类别id  类别商品计数/ 概率对数
     self.dict_class = {}
     self.class_num = 0
     self.class_class = np.zeros((2, 2))
     # 原始人工经验
     self.exp_peo = exp_of_people()
     self.exp_peo.read_jingyan()
     # self.matrix_item = np.zeros((10000000,3))
     # 概率优化模块
     self.pro_guji = Pro_estimate()
     # 只考虑 最热的 6万 商品
     self.item_top_k = 60000
     # 原始的搭配概率
     self.p_match = 0.0006  # 任意随机商品 搭配的概率
     pass
Beispiel #3
0
 def __init__(self):
     self.data_dir = 'E:\\gitshell\\tianchi2'
     self.user_dict = {}
     self.user_num = -1
     self.record_num = -1  # 记录最大编号 +1 为购买记录数
     self.user_array = np.zeros((2000000, 2), int)  # 记录 购买行为的 起末位置
     self.user_item_array = np.zeros((20000000, 2), int)
     # 商品热度统计数据
     self.item_num = -1  # 记录最大编号 +1为商品数
     self.item_dict = {}
     self.item_array = np.zeros((2000000, 2))  # 商品id, 商品数/概率
     self.item_user_list = []
     # 商品分类信息
     self.item_class = np.zeros([0] * 20)
     self.class_dict = {}
     self.class_num = -1  # 记录最大编号 +1为分类数
     # 热度排行初过滤参数  只对最畅销的 n 个商品进行精细计算
     self.top_k = 100000
     self.simple = True
     # 分类别关联性 商品热度统计
     self.num_k = 5  # 邻近的num_k个自身算第一个 被认为有关联
     self.like_matrix = np.zeros((10, 10), int)  # 存储不同分类下的
     # self.matrix = np.zeros((self.top_k+1,self.class_num+1), int)
     # 需要测试的数据组
     self.test_list = []
     # 关联商品的热度分布
     self.temp_item_array_hot = np.array([0] * 10)
     # 结果输出相关参数
     self.r_top_num = 200  # 取前200个商品
     # 购买次序相关的权重
     self.range = 10  # 购买次序的有效关联范围
     self.day_diff = 3  # 时间差 不超过3天
     self.order_weight = []
     # 达人的人工经验
     self.peo_exp = exp_of_people()
     self.peo_exp.read_jingyan()
     # 搭配概率
     self.top_k_da = 60000
     self.pro_da_pei = np.array([0.0] * self.top_k_da)
     # 原始的搭配概率
     self.p_match = 0.0006
     self.class_class = 0
Beispiel #4
0
 def __init__(self):
     self.data_dir = "E:\\gitshell\\tianchi2"
     self.user_dict = {}
     self.user_num = -1
     self.record_num = -1  # 记录最大编号 +1 为购买记录数
     self.user_array = np.zeros((2000000, 2), int)  # 记录 购买行为的 起末位置
     self.user_item_array = np.zeros((20000000, 2), int)
     # 商品热度统计数据
     self.item_num = -1  # 记录最大编号 +1为商品数
     self.item_dict = {}
     self.item_array = np.zeros((2000000, 2))
     self.item_user_list = []
     # 商品分类信息
     self.item_class = np.zeros([0] * 20)
     self.class_dict = {}
     self.class_num = -1  # 记录最大编号 +1为分类数
     # 热度排行初过滤参数  只对最畅销的 n 个商品进行精细计算
     self.top_k = 100000
     self.simple = True
     # 分类别关联性 商品热度统计
     self.num_k = 5  # 邻近的num_k个自身算第一个 被认为有关联
     self.like_matrix = np.zeros((10, 10), int)  # 存储不同分类下的
     # self.matrix = np.zeros((self.top_k+1,self.class_num+1), int)
     # 需要测试的数据组
     self.test_list = []
     # 关联商品的热度分布
     self.temp_item_array_hot = np.array([0] * 10)
     # 结果输出相关参数
     self.r_top_num = 200  # 取前200个商品
     # 购买次序相关的权重
     self.range = 10  # 购买次序的有效关联范围
     self.day_diff = 3  # 时间差 不超过3天
     self.order_weight = []
     # 达人的人工经验
     self.peo_exp = exp_of_people()
     self.peo_exp.read_jingyan()