通过阿里天池提供的2017年11月25日-2017年12月3日的用户行为数据,尝试分析得出对业务有用的优化建议。
一、数据来源
2、网上搜集得来的数据SQL文件
二、理解数据
三、提出问题
1、各环节转化率如何?转化率低的原因?
2、用户访问峰值时段?
3、用户RFM分级?
4、转化率top10的商品品类、商品?
四、分析思路
五、数据预处理
1、数据整体认知
select count(distinct user_id) as 用户数,
count(distinct item_id) as 商品数,
count(distinct category_id) as 品类数
from userbehavior;
+--------+--------+--------+
| 用户数 | 商品数 | 品类数 |
+--------+--------+--------+
| 983 | 64467 | 3128 |
+--------+--------+--------+
1 row in set (3.49 sec)
共统计983名用户,64467个商品,3128个品类。
2、重复值查询处理
select * from userbehavior
group by item_id,user_id,timestamp
having count(*)>1;
Empty set (0.00 sec)
无重复值
3、缺失值查询处理
select * from userbehavior
where user_id is null
or item_id is null
or category_id is null
or behavior_type is null
or timestamp is null;
Empty set (0.00 sec)
无缺失值
4、时间戳处理
alter table userbehavior add dates date;//添加一个date格式的dates(日)字段
update userbehavior set dates =from_unixtime(timestamp);//使用from_unixtime函数转换时间戳
alter table userbehavior add t