接上面两篇文章,只提取10个特征,是远远不够的。看了一些参加S2比赛的博客总结,先通过一些强规则(SQL)来确定结果。
获取前一日(12.18)添加了购物车,当天没有购买过并且在商品子集中的 U-I组合。
SQL写法:
--筛选出12.18添加进购物车的
select a.user_id,a.item_id from
(select * from
vipfin.tianchi_fresh_comp_train_user where substr( time,1,10) ='2014-12-18'
and behavior_type=3) a
inner join
--未购买过的
(select user_id,item_id from vipfin.tianchi_fresh_comp_train_user where substr( time,1,10) ='2014-12-18' and behavior_type<>4
group by user_id,item_id
) b
on a.user_id=b.user_id
and a.item_id =b.item_id
--在商品子集的
inner join
vipfin.tianchi_fresh_comp_train_item c
on a.item_id=c.item_id
将这一版提交到系统,准确率和F1值分别