当前位置: 首页 > news >正文

下载软件的appseo网络推广优化教程

下载软件的app,seo网络推广优化教程,wordpress信息发布系统,宁波seo关键词优化制作文章目录 1.数据加载2.查看数据情况3.数据合并及填充4.查看特征字段之间相关性5.聚合操作6.时间维度上看销售额7.计算用户RFM8.数据保存存储(1).to_csv(1).to_pickle 1.数据加载 import pandas as pd dataset pd.read_csv(SupplyChain.csv, encodingunicode_escape) dataset2… 文章目录 1.数据加载2.查看数据情况3.数据合并及填充4.查看特征字段之间相关性5.聚合操作6.时间维度上看销售额7.计算用户RFM8.数据保存存储(1).to_csv(1).to_pickle 1.数据加载 import pandas as pd dataset pd.read_csv(SupplyChain.csv, encodingunicode_escape) dataset2.查看数据情况 print(dataset.shape) print(dataset.isnull().sum())3.数据合并及填充 print(dataset[[Customer Fname, Customer Lname]]) # fistname与lastname进行合并 dataset[Customer Full Name] dataset[Customer Fname] dataset[Customer Lname] #dataset.head() dataset[Customer Zipcode].value_counts() # 查看缺失值发现有3个缺失值 print(dataset[Customer Zipcode].isnull().sum())dataset[Customer Zipcode] dataset[Customer Zipcode].fillna(0) dataset.head()4.查看特征字段之间相关性 import matplotlib.pyplot as plt import seaborn as sns # 特征字段之间相关性 热力图 data dataset plt.figure(figsize(20,10)) # annotTrue 显示具体数字 sns.heatmap(data.corr(), annotTrue, cmapcoolwarm) # 结论可以观察到Product Price和SalesOrder Item Total有很高的相关性5.聚合操作 # 基于Market进行聚合 market data.groupby(Market) # 基于Region进行聚合 region data.groupby(Order Region) plt.figure(1) market[Sales per customer].sum().sort_values(ascendingFalse).plot.bar(figsize(12,6), titleSales in different markets) plt.figure(2) region[Sales per customer].sum().sort_values(ascendingFalse).plot.bar(figsize(12,6), titleSales in different regions) plt.show()# 基于Category Name进行聚类 cat data.groupby(Category Name) plt.figure(1) # 不同类别的 总销售额 cat[Sales per customer].sum().sort_values(ascendingFalse).plot.bar(figsize(12,6), titleTotal sales) plt.figure(2) # 不同类别的 平均销售额 cat[Sales per customer].mean().sort_values(ascendingFalse).plot.bar(figsize(12,6), titleTotal sales) plt.show()6.时间维度上看销售额 #data[order date (DateOrders)] # 创建时间戳索引 temp pd.DatetimeIndex(data[order date (DateOrders)]) temp# 取order date (DateOrders)字段中的year, month, weekday, hour, month_year data[order_year] temp.year data[order_month] temp.month data[order_week_day] temp.weekday data[order_hour] temp.hour data[order_month_year] temp.to_period(M) data.head()# 对销售额进行探索按照不同时间维度 年星期小时月 plt.figure(figsize(10, 12)) plt.subplot(4, 2, 1) df_year data.groupby(order_year) df_year[Sales].mean().plot(figsize(12, 12), titleAverage sales in years) plt.subplot(4, 2, 2) df_day data.groupby(order_week_day) df_day[Sales].mean().plot(figsize(12, 12), titleAverage sales in days per week) plt.subplot(4, 2, 3) df_hour data.groupby(order_hour) df_hour[Sales].mean().plot(figsize(12, 12), titleAverage sales in hours per day) plt.subplot(4, 2, 4) df_month data.groupby(order_month) df_month[Sales].mean().plot(figsize(12, 12), titleAverage sales in month per year) plt.tight_layout() plt.show()# 探索商品价格与 销售额之间的关系 data.plot(xProduct Price, ySales per customer) plt.title(Relationship between Product Price and Sales per customer) plt.xlabel(Product Price) plt.ylabel(Sales per customer) plt.show()7.计算用户RFM # # 用户分层 RFM data[TotalPrice] data[Order Item Quantity] * data[Order Item Total] data[[TotalPrice, Order Item Quantity, Order Item Total]]# 时间类型转换 data[order date (DateOrders)] pd.to_datetime(data[order date (DateOrders)]) # 统计最后一笔订单的时间 data[order date (DateOrders)].max()# 假设我们现在是2018-2-1 import datetime present datetime.datetime(2018,2,1) # 计算每个用户的RFM指标 # 按照Order Customer Id进行聚合 customer_seg data.groupby(Order Customer Id).agg({order date (DateOrders): lambda x: (present-x.max()).days, Order Id: lambda x:len(x), TotalPrice: lambda x: x.sum()}) customer_seg# 将字段名称改成 RFM customer_seg.rename(columns{order date (DateOrders): R_Value, Order Id: F_Value, TotalPrice: M_Value}, inplaceTrue) customer_seg.head()# 将RFM数据划分为4个尺度 quantiles customer_seg.quantile(q[0.25, 0.5, 0.75]) quantiles quantiles.to_dict() quantiles# R_Value越小越好 R_Score就越大 def R_Score(a, b, c):if a c[b][0.25]:return 4elif a c[b][0.50]:return 3elif a c[b][0.75]:return 2else:return 1# F_Value, M_Value越大越好 def FM_Score(a, b, c):if a c[b][0.25]:return 1elif a c[b][0.50]:return 2elif a c[b][0.75]:return 3else:return 4# 新建R_Score字段用于将R_Value [1,4] customer_seg[R_Score] customer_seg[R_Value].apply(R_Score, args(R_Value, quantiles)) # 新建F_Score字段用于将F_Value [1,4] customer_seg[F_Score] customer_seg[F_Value].apply(FM_Score, args(F_Value, quantiles)) # 新建M_Score字段用于将R_Value [1,4] customer_seg[M_Score] customer_seg[M_Value].apply(FM_Score, args(M_Value, quantiles)) customer_seg.head()# 计算RFM用户分层 def RFM_User(df):if df[M_Score] 2 and df[F_Score] 2 and df[R_Score] 2:return 重要价值用户if df[M_Score] 2 and df[F_Score] 2 and df[R_Score] 2:return 重要发展用户if df[M_Score] 2 and df[F_Score] 2 and df[R_Score] 2:return 重要保持用户if df[M_Score] 2 and df[F_Score] 2 and df[R_Score] 2:return 重要挽留用户if df[M_Score] 2 and df[F_Score] 2 and df[R_Score] 2:return 一般价值用户if df[M_Score] 2 and df[F_Score] 2 and df[R_Score] 2:return 一般发展用户if df[M_Score] 2 and df[F_Score] 2 and df[R_Score] 2:return 一般保持用户if df[M_Score] 2 and df[F_Score] 2 and df[R_Score] 2:return 一般挽留用户 customer_seg[Customer_Segmentation] customer_seg.apply(RFM_User, axis1) customer_seg8.数据保存存储 (1).to_csv customer_seg.to_csv(supply_chain_rfm_result.csv, indexFalse)(1).to_pickle # 数据预处理后将处理后的数据进行保存 data.to_pickle(data.pkl)参考资料开课吧
http://www.hkea.cn/news/14588708/

相关文章:

  • 网站建设扌金手指六六在招聘网站做电话销售怎么样
  • .net 网站开发框架牡丹江seo
  • 郑州网站开发公江门网站建设推广策划
  • 衡阳网站seo优化百度推广授权代理商
  • 搞笑视频网站建设策划书网页制作与网站建设实战大全 pdf下载
  • 海外网站搭建芜湖做网站优化
  • 上海电子商城网站制作海丰建设局网站
  • 网站取消301后久久建筑网施工方案好用吗
  • 成都设计公司工资多少云南seo简单整站优化
  • 现在有没有免费的网站空间绍兴公司企业名单
  • 牛网站建设想做网站的公司好
  • 建站公司 知乎 discuz商务网站内容维护范围
  • 做软件的叫什么职业网站标题具体怎样优化
  • 安平县护栏网站建设桌面百度
  • 宝华路桥建设集团网站wordpress 如何汉化主题
  • 网站制作 公司资质wordpress分类下文章置顶
  • python做的网站如何部署做淘宝内部优惠券网站要钱么
  • 网站值不值得做seo2023年楼市将迎来抛售潮
  • 网址导航网站可信软件开发工程师
  • 网站备案在哪查八面通网站建设
  • 青岛网站建设排名微信微网站开发报价单
  • 各大网站搜索引擎入口互联网保险产品
  • 网站ip被屏蔽怎么办淮南市网站开发的方式
  • 建设局是干嘛的单位想学做网站seo 在哪学 电话多少
  • 得到做网站公司品牌网站建设帮你大蝌蚪
  • iis 网站权限360建筑网中级机械工程师招聘
  • 中铁建设投资集团有限公司招聘网站企业应加强自身网站建设
  • 医药平台网站建设wordpress破图
  • 一站式做网站技术常州网上教科院
  • 北京网站建设找降龙湖南平台网站建设推荐