毕业设计 大数据电商用户行为分析及可视化(源码+论文)

发布时间:2026/10/5 1:40:38

毕业设计 大数据电商用户行为分析及可视化(源码+论文) 文章目录0 简介1. 数据集说明2. 数据处理2.1 数据导入2.2 数据清洗3.数据分析可视化3.1 用户流量及购物情况3.2 用户行为转换率3.3 用户行为习惯3.4 基于 RFM 模型找出有价值的用户3.5 商品维度的分析0 简介今天学长向大家介绍一个机器视觉的毕设项目大数据电商用户行为分析及可视化(源码论文)项目运行效果毕业设计 基于大数据淘宝用户行为分析项目分享见主页任意置顶文章1. 数据集说明这是一份来自淘宝的用户行为数据时间区间为 2017-11-25 到 2017-12-03总计 100,150,807 条记录大小为 3.5 G包含 5 个字段。2. 数据处理2.1 数据导入将数据加载到 hive, 然后通过 hive 对数据进行数据处理。-- 建表droptableifexistsuser_behavior;createtableuser_behavior(user_idstringcomment用户ID,item_idstringcomment商品ID,category_idstringcomment商品类目ID,behavior_typestringcomment行为类型枚举类型包括(pv, buy, cart, fav),timestampintcomment行为时间戳,datetimestringcomment行为时间)rowformat delimitedfieldsterminatedby,linesterminatedby\n;-- 加载数据LOADDATALOCALINPATH/home/getway/UserBehavior.csvOVERWRITEINTOTABLEuser_behavior;2.2 数据清洗数据处理主要包括删除重复值时间戳格式化删除异常值。--数据清洗去掉完全重复的数据insertoverwritetableuser_behaviorselectuser_id,item_id,category_id,behavior_type,timestamp,datetimefromuser_behaviorgroupbyuser_id,item_id,category_id,behavior_type,timestamp,datetime;--数据清洗时间戳格式化成 datetimeinsertoverwritetableuser_behaviorselectuser_id,item_id,category_id,behavior_type,timestamp,from_unixtime(timestamp,yyyy-MM-dd HH:mm:ss)fromuser_behavior;--查看时间是否有异常值selectdate(datetime)asdayfromuser_behaviorgroupbydate(datetime)orderbyday;--数据清洗去掉时间异常的数据insertoverwritetableuser_behaviorselectuser_id,item_id,category_id,behavior_type,timestamp,datetimefromuser_behaviorwherecast(datetimeasdate)between2017-11-25and2017-12-03;--查看 behavior_type 是否有异常值selectbehavior_typefromuser_behaviorgroupbybehavior_type;3.数据分析可视化3.1 用户流量及购物情况--总访问量PV总用户量UVselectsum(casewhenbehavior_typepvthen1else0end)aspv,count(distinctuser_id)asuvfromuser_behavior;--日均访问量日均用户量selectcast(datetimeasdate)asday,sum(casewhenbehavior_typepvthen1else0end)aspv,count(distinctuser_id)asuvfromuser_behaviorgroupbycast(datetimeasdate)orderbyday;--每个用户的购物情况加工到 user_behavior_countcreatetableuser_behavior_countasselectuser_id,sum(casewhenbehavior_typepvthen1else0end)aspv,--点击数sum(casewhenbehavior_typefavthen1else0end)asfav,--收藏数sum(casewhenbehavior_typecartthen1else0end)ascart,--加购物车数sum(casewhenbehavior_typebuythen1else0end)asbuy--购买数fromuser_behaviorgroupbyuser_id;--复购率产生两次或两次以上购买的用户占购买用户的比例selectsum(casewhenbuy1then1else0end)/sum(casewhenbuy0then1else0end)fromuser_behavior_count;小结2017-11-25 到 2017-12-03 这段时间PV 总数为 89,660,671 UV 总数为 987,991。从日均访问量趋势来看进入 12 月份之后有一个比较明显的增长猜测可能是因为临近双 12 电商活动引流产生另外2017-12-02 和 2017-12-03 刚好是周末也可能是周末的用户活跃度本来就比平常高。总体的复购率为 66.01%说明用户的忠诚度比较高。3.2 用户行为转换率--点击/(加购物车收藏)/购买 , 各环节转化率selecta.pv,a.fav,a.cart,a.fava.cartasfavcart,a.buy,round((a.fava.cart)/a.pv,4)aspv2favcart,round(a.buy/(a.fava.cart),4)asfavcart2buy,round(a.buy/a.pv,4)aspv2buyfrom(selectsum(pv)aspv,--点击数sum(fav)asfav,--收藏数sum(cart)ascart,--加购物车数sum(buy)asbuy--购买数fromuser_behavior_count)asa;小结2017-11-25 到 2017-12-03 这段时间点击数为 89,660,671 收藏数为 2,888,258加购物车数为5,530,446购买数为 2,015,807。总体的转化率为 2.25%这个值可能是比较低的从加到购物车数来看有可能部分用户是准备等到电商节日活动才进行购买。所以合理推断一般电商节前一段时间的转化率会比平常低。3.3 用户行为习惯-- 一天的活跃时段分布selecthour(datetime)ashour,sum(casewhenbehavior_typepvthen1else0end)aspv,--点击数sum(casewhenbehavior_typefavthen1else0end)asfav,--收藏数sum(casewhenbehavior_typecartthen1else0end)ascart,--加购物车数sum(casewhenbehavior_typebuythen1else0end)asbuy--购买数fromuser_behaviorgroupbyhour(datetime)orderbyhour;--一周用户的活跃分布selectpmod(datediff(datetime,1920-01-01)-3,7)asweekday,sum(casewhenbehavior_typepvthen1else0end)aspv,--点击数sum(casewhenbehavior_typefavthen1else0end)asfav,--收藏数sum(casewhenbehavior_typecartthen1else0end)ascart,--加购物车数sum(casewhenbehavior_typebuythen1else0end)asbuy--购买数fromuser_behaviorwheredate(datetime)between2017-11-27and2017-12-03groupbypmod(datediff(datetime,1920-01-01)-3,7)orderbyweekday;小结晚上21点-22点之间是用户一天中最活跃的时候凌晨 4 点则是活跃度最低的时候。一周中工作日活跃度都差不多到了周末活跃度有明显提高。3.4 基于 RFM 模型找出有价值的用户RFM 模型是衡量客户价值和客户创利能力的重要工具和手段其中由3个要素构成了数据分析最好的指标分别是R-Recency最近一次购买时间F-Frequency消费频率M-Money消费金额--R-Recency最近一次购买时间, R值越高一般说明用户比较活跃selectuser_id,datediff(2017-12-04,max(datetime))asR,dense_rank()over(orderbydatediff(2017-12-04,max(datetime)))asR_rankfromuser_behaviorwherebehavior_typebuygroupbyuser_idlimit10;--F-Frequency消费频率, F值越高说明用户越忠诚selectuser_id,count(1)asF,dense_rank()over(orderbycount(1)desc)asF_rankfromuser_behaviorwherebehavior_typebuygroupbyuser_idlimit10;--M-Money消费金额数据集无金额所以就不分析这一项对有购买行为的用户按照排名进行分组共划分为5组前 - 1/5 的用户打5分前 1/5 - 2/5 的用户打4分前 2/5 - 3/5 的用户打3分前 3/5 - 4/5 的用户打2分前 4/5 - 的用户打1分按照这个规则分别对用户时间间隔排名打分和购买频率排名打分最后把两个分数合并在一起作为该名用户的最终评分withcteas(selectuser_id,datediff(2017-12-04,max(datetime))asR,dense_rank()over(orderbydatediff(2017-12-04,max(datetime)))asR_rank,count(1)asF,dense_rank()over(orderbycount(1)desc)asF_rankfromuser_behaviorwherebehavior_typebuygroupbyuser_id)selectuser_id,R,R_rank,R_score,F,F_rank,F_score,R_scoreF_scoreASscorefrom(select*,casentile(5)over(orderbyR_rank)when1then5when2then4when3then3when4then2when5then1endasR_score,casentile(5)over(orderbyF_rank)when1then5when2then4when3then3when4then2when5then1endasF_scorefromcte)asaorderbyscoredesclimit20;小结可以根据用户的价值得分进行个性化的营销推荐。3.5 商品维度的分析--销量最高的商品selectitem_id,sum(casewhenbehavior_typepvthen1else0end)aspv,--点击数sum(casewhenbehavior_typefavthen1else0end)asfav,--收藏数sum(casewhenbehavior_typecartthen1else0end)ascart,--加购物车数sum(casewhenbehavior_typebuythen1else0end)asbuy--购买数fromuser_behaviorgroupbyitem_idorderbybuydesclimit10;--销量最高的商品大类selectcategory_id,sum(casewhenbehavior_typepvthen1else0end)aspv,--点击数sum(casewhenbehavior_typefavthen1else0end)asfav,--收藏数sum(casewhenbehavior_typecartthen1else0end)ascart,--加购物车数sum(casewhenbehavior_typebuythen1else0end)asbuy--购买数fromuser_behaviorgroupbycategory_idorderbybuydesclimit10;小结缺失商品维表所以没有太多分析价值。假如有商品维表可以再展开以商品纬度进行分析比如不同行业、不同产品的转化率还有竞品分析等等。项目运行效果毕业设计 基于大数据淘宝用户行为分析项目分享见主页任意置顶文章详细分析文档
延伸阅读

更多相关文章

2026/10/4 17:20:21

版权保护知多少|守护创意,从尊重开始

每一份作品背后,都藏着创作者的心血与热爱。 尊重劳动、保护创新,是我们共同的底线,也是共同的使命。关于版权保护,你了解多少? 今天,我们一起把“版权”这件事说清楚👇📖 什么是版权…

2026/10/5 1:40:38

海力冠实测:15天间隔施用增产23%? 农户必看科学方案

在农业生产实践中,合理掌握功能性产品的施用间隔是确保效果稳定的关键因素。作为具有多重功效的农业投入品,科学的应用频率直接影响其在增产提质、缓解药害、增强抗旱性及促进根系发育等方面的表现。一、施用间隔的科学依据 实验数据表明(表1…

2026/10/5 1:37:13

MRAM工业存储实战:MR25H40CDF与STM32G431RB驱动开发与掉电保护

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/5 1:37:13

基于多光谱rPPG的非接触式睡眠血氧监测:原理到工程实践

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/5 1:37:13

BMS高精度电流采样:AS8510模拟前端设计与调试全解析

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/5 1:32:13

STM32L031C6驱动MR25H40CDF MRAM:工业数据采集存储方案

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

2026/10/4 0:01:02

Jev+Agent接管浏览器:browser-use实战与jev-ultrafast性能优化

1. 从“Jev”说起:为什么我要把Agent接进浏览器“Jev”这个词最近在圈子里出现的频率越来越高,很多人第一次听到会以为是某个新模型的名字,其实它更像是一种思路——把Jev模型的能力当作底座,通过Agent的方式去接管浏览器&#xf…

2026/10/4 0:01:02

多智能体集群实战:DeepAgents编排、MCP与A2A协议及Skills体系

1. 从"单兵作战"到"集群协同":多智能体编排到底在解决什么问题如果你最近在折腾 Agent 相关的东西,大概率会有一种感觉:单个 Agent 能做的事情,其实很快就摸到天花板了。你给它一个提示词,挂几个工…

2026/10/4 1:01:05

无源低通滤波器设计实战:从RC到LC,手把手教你避开那些坑

/* MD / 富文本中的 .toc(含博客园搬家等嵌套结构);.toc-box 在侧栏,不受影响 */#content_views .toc,/* 编辑器常在目录前后插入空 p(:empty 仍占 20px),一并去掉避免顶空隙 */#content_views.markdown_views > p:empty:has(+ .toc),#content_views.markdown_views …

还想了解更多?直接咨询顾问

免费诊断 + 免费方案 + 透明报价。

全国咨询热线400-8866-253
免费获取方案
☎咨询二维码 ☎ ↑