【Python 数据分析 实战案例】通过用户和订单的数据分析,制定营销策略

Python 数据智能实战 (14):[综合实战] 智能用户分群与精准营销策略生成 — 终极演练!从数据到策略,融合 LLM 完成端到端电商用户运营项目各位数据智能探索者,欢迎来到我们专栏的终极实战关卡!经过前面一系列的学习和实践,我们已经不再仅仅是数据的处理者和分析者,更是具备了利用大语言模型 (LLM) 这一前沿 AI 技术,从数据中挖掘更深层价值、驱动更智能决策的潜力探索者。我们学会了如何让 Python 与 LLM 对话,如何利用 Embeddings 理解文本语义,如何将 LLM 特征融入传统模型,如何评估效果并坚守安全底线。 阅读详情

在互联网行业中,电子商务领域绝对是数据分析用途最多的地方,各大电商平台都依赖数据分析帮助其挖掘用户订单增长机会。比如某宝的随手买一件,核心思路也就是根据用户的日常浏览内容及停留时间,以及订单的关联度来进行推荐的。

本篇文章,我们来通过一个真实的电商数据集进行分析,在复习前面内容的基础上,也可以感受一下电商数据分析的分析流程。

1、需求说明

最近某个电商网站需要策划一场推广活动,通过发短信的方式,向客户发送广告和优惠信息,吸引他们来购物。但由于预算及短信限制,无法对全量客户发送,需要找出最有可能转化的人群,定向发送推广信息,同时,下单的行为往往也跟时间呈现一定的关联关系,推送时间也需要考虑。

基于以上的需求说明,作为数据分析师,我们就需要根据需求,制定自己的分析计划。那么我们的任务就是:

  • 通过数据分析,找到最有可能转化的人群特征(比如年龄、性别、地域等)。
  • 通过数据分析,给出最适合发送推广短信的时间。

任务明确之后,就需要考虑我们要完成以上任务,需要哪些数据支撑,开始找数据部门提供相应的数据支持。

通过一顿友(唇)好(枪)协(舌)商(战),最终从数据部门要到如下数据:

  • 用户行为表:最近6个月的用户行为数据。也就是下单数据
  • VIP数据:用户VIP会员开通数据。
  • 用户数据:用户个人信息相关数据。

拿到数据之后,我们就可以大展拳脚了。

2、数据集获取及分析

为了方便我们学习,需要自己模拟一些相关数据,不想模拟的话,可以在公众号联系获取。

拿到数据后,解压后可以看到如下几个文件:

  • user_behavior_time_resampled.csv (用户行为数据)
  • vip_users.csv (VIP用户数据)
  • user_info.csv(用户数据)

我们先来看一下各个表的字段说明:

user_behavior_time_resampled.csv vip_users.csv

user_info.csv

3、加载数据

从这里开始,我们就开始使用我们前面了解的一些包和库来读取数据了,这里首先是使用pandas来加载数据。

import pandas as pd
df_user_log = pd.read_csv("EComm/user_behavior_time_resampled.csv")

df_vip_user = pd.read_csv("EComm/vip_user.csv")

df_user_info = pd.read_csv("EComm/user_info.csv")

df_user_log

df_vip_user

df_user_info

加载完后,输出如下:

❝

这里,df_user_log表中有一个 time_stamp 和 timestamp 字段,我们需要了解一下这两个字段的意思。

利用Python和SQL进行数据分析:纯思路 本文将结合我的实际工作经验,为大家分享如何利用Python和SQL进行高效的数据分析和处理,并通过实战案例展示其强大功能,希望能为大家带来一些启发和帮助。随着数据量的不断增长和数据分析需求的日益复杂,Python和SQL在数据分析中的地位将越来越重要。在实际的数据分析项目中,数据清洗往往占据了大量的时间。通过绘制柱状图、折线图、散点图等,我们可以快速发现数据中的规律和趋势,为后续的建模和预测提供依据。相信通过本文的分享和实战案例的展示,大家已经对Python和SQL在数据分析中的应用有了更深入的了解。 阅读详情

相关推荐

超市RFM用户分层实战案例源码和数据集分享

之前我就已经做过B站相关的推荐了这里我就不废话了直接上代码,RFM都不知道是啥东西的多去看看其他博主写的 本次数据集获取方式: 关注:YOLO的学习进阶日常 回复:RFM用户分层实战案例 import pandas as pd import numpy as np data=pd.read_csv("./supermarket_data.csv",encoding="gbk") data.head() 客户名称 付款日期 国家/

qq_42907061的博客 3086

探索电商运营中的智能营销策略

随着互联网技术的飞速发展,电商行业竞争日益激烈。传统的营销方式已经难以满足电商企业的发展需求,智能营销策略应运而生。本文的目的在于深入探索电商运营中的智能营销策略,涵盖从核心概念到实际应用的各个方面,包括智能营销的原理、算法、实际案例以及未来发展趋势等,旨在为电商从业者提供全面且实用的智能营销知识,帮助他们在电商运营中更好地运用智能营销手段,提高营销效果和竞争力。本文共分为十个部分。第一部分为背景介绍,阐述了文章的目的、预期读者和文档结构概述,并给出了相关术语的定义。

2501_92132293的博客 742

数据分析案例-顾客购物数据可视化分析

本项目旨在通过数据可视化技术,对顾客购物数据进行深入挖掘和分析,为商家提供全面的市场分析和商业洞察。通过使用先进的数据可视化工具和技术,我们将从大量的顾客购物数据中提取有价值的信息,并通过直观的图形展示出来,帮助商家更好地理解市场和消费者行为,优化商业决策。

m0_64336780的博客 1万+

基于 Python 的电商用户画像构建与营销策略分析案例

在电商行业的激烈竞争中,精准把握用户需求、实施个性化营销策略成为企业脱颖而出的关键。构建详细准确的用户画像,能够深入了解用户特征、行为习惯和消费偏好,为企业决策提供有力支撑。在如此庞大的市场规模下,通过数据分析实现精准营销的需求愈发迫切。本案例运用 Python 技术,对某电商平台用户数据进行深度挖掘,构建用户画像,并基于此制定针对性营销策略。通过上述改进,能够显著提升数据收集的灵活性、数据清洗的精准度、用户画像构建的完整性以及营销策略制定的针对性,助力电商企业更精准地把握用户需求,提升市场竞争力。

daqsdfas的博客 1540

电商运营中的数据分析与市场策略

随着互联网技术的飞速发展,电子商务已成为商业领域的重要组成部分。电商运营的成功与否直接关系到企业的生存和发展。在电商运营过程中,涉及到海量的数据,如用户行为数据、销售数据、市场竞争数据等。如何从这些数据中提取有价值的信息,制定有效的市场策略,是电商企业面临的重要挑战。本文的目的就是探讨如何运用数据分析的方法和技术,为电商运营制定科学合理的市场策略,提高电商企业的竞争力和盈利能力。

AI Agent Harness Engineering 1091

Tesla V100 Windows 部署实战:从驱动安装到模式切换的避坑指南

本文是一份详细的Tesla V100在Windows系统下的部署实战指南。文章从硬件组装、系统选择讲起,重点阐述了驱动安装的正确方法,并深入剖析了将计算卡从TCC模式切换至WDDM模式的诱惑与潜在陷阱。最终,作者推荐保持默认TCC模式,并提供了使用nvidia-smi命令行等稳定可靠的显卡监控方案,旨在帮助用户避开常见坑点,高效利用这张专业计算卡进行AI计算等任务。

java5的博客 1733

拆开华为BBU5900,看看5G基站的大脑里到底装了啥?

本文深度拆解华为BBU5900,揭示5G基站核心处理单元的硬件架构与设计哲学。通过详细解析模块化设计、智能电源系统和动态散热方案,展现其支撑千兆速率、毫秒级时延的技术奥秘,为5G网络部署提供实用参考。

weixin_31456563的博客 585

Unity WebGL发布避坑指南:从内存设置到字体打包,一次搞定所有常见问题

本文详细解析Unity WebGL发布的完整流程,从内存设置到字体打包,提供全面的避坑指南。涵盖关键检查清单、内存与性能优化配置、资源处理专项优化及平台适配技巧,帮助开发者高效解决常见问题,确保项目顺利发布。

weixin_28693309的博客 149

【Mode】FDE 求解器工作流程

Lumerical---FDE(Finite Difference Eigenmode) Solver

u011699626的博客 4953

rk3576 适配摄像头 (mipi 五摄)

在RK3576上实现五路CSI摄像头方案,核心思路是充分复用其视频输入接口,并通过巧妙的软件配置来实现。

weixin_35723192的博客 188

基于共识的捆绑算法CBBA在多无人机多任务调度中的实现

在捆绑过程中,每个无人机根据自己的任务清单和其他无人机的任务清单,确定一个被称为“束”的集合。通过合理的任务分配和无人机协作,CBBA算法能够实现最优的任务调度,提高了多无人机系统的效率和执行能力。在每一轮迭代中,无人机根据自己的当前任务和位置信息将任务清单发送给其他无人机,并接收其他无人机发送过来的任务清单。通过比较其他无人机的任务清单和自身的任务清单,每个无人机可以更新自己的任务分配情况。在这一步中,每个无人机根据自己选择的新任务,更新自身的任务清单,并将更新后的清单发送给其他无人机。

持续更新 1156

ROS & ROS2 机器人深度相机激光雷达多传感器标定工具箱入门教程(一)

multisensor_calibration 是一个积极维护的通用标定工具箱,用于辅助基于目标的多传感器标定,支持 ROS 1 和 ROS 2。它提供了多种方法和应用来标定复杂的多传感器系统,例如。

2506_90492529的博客 3268

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

IMSL CNL 7.0.0 (x86-64)Crack

IMSL CNL 7.0.0 (x86-64)Crack intel的算法库破解文件,这是C++版本的破解文件

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

上一篇: Python的数据分析与爬虫
下一篇: Python在金融大数据分析中的AI应用实战
田野猫咪
博客等级 码龄4年 5096粉丝 501原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址