11-APP评分数据案例分析

#调用基本包
import pandas as pd
#数据读取
app=pd.read_csv('11-w1-applestore.csv')
#数据的基本信息
app.info()
<class 'pandas.core.frame.DataFrame'>
RangeIndex: 7197 entries, 0 to 7196
Data columns (total 11 columns):
Unnamed: 0          7197 non-null int64
id                  7197 non-null int64
track_name          7197 non-null object
size_bytes          7197 non-null int64
price               7197 non-null float64
rating_count_tot    7197 non-null int64
user_rating         7197 non-null float64
prime_genre         7197 non-null object
sup_devices         7197 non-null int64
ipadSc_urls         7197 non-null int64
lang                7197 non-null int64
dtypes: float64(2), int64(7), object(2)
memory usage: 618.6+ KB
app.head()
Unnamed: 0idtrack_namesize_bytespricerating_count_totuser_ratingprime_genresup_devicesipadSc_urlslang
00281656475PAC-MAN Premium1007882243.99212924.0Games38510
11281796108Evernote - stay organized1585786880.001610654.0Productivity37523
22281940292WeatherBug - Local Weather, Radar, Maps, Alerts1005240320.001885833.5Weather3753
33282614216eBay: Best App to Buy, Sell, Save! Online Shop...1285120000.002622414.0Shopping3759
44282935706Bible927744000.009859204.5Reference37545
#发现了unname 0这个奇怪的变量,需要进行清理
app.drop('Unnamed: 0',axis=1,inplace=True)
#drop默认是对行
#inplace表示直接替换掉原有数据
#同样可以用位置来举
#app.drop(app.columns[0],axis=1,inplace=True)
#对数据型变量的整体描述
app.describe()    #只对整数与浮点数进行计算
idsize_bytespricerating_count_totuser_ratingsup_devicesipadSc_urlslang
count7.197000e+037.197000e+037197.0000007.197000e+037197.0000007197.0000007197.0000007197.000000
mean8.631310e+081.991345e+081.7262181.289291e+043.52695637.3618173.7071005.434903
std2.712368e+083.592069e+085.8330067.573941e+041.5179483.7377151.9860057.919593
min2.816565e+085.898240e+050.0000000.000000e+000.0000009.0000000.0000000.000000
25%6.000937e+084.692275e+070.0000002.800000e+013.50000037.0000003.0000001.000000
50%9.781482e+089.715302e+070.0000003.000000e+024.00000037.0000005.0000001.000000
75%1.082310e+091.819249e+081.9900002.793000e+034.50000038.0000005.0000008.000000
max1.188376e+094.025970e+09299.9900002.974676e+065.00000047.0000005.00000075.000000
# 考虑将sizebytes变成mb,新增数据
app['size_mb'] = app['size_bytes'] / (1024 * 1024.0)
app.size_mb.describe()
count    7197.000000
mean      189.909414
std       342.566408
min         0.562500
25%        44.749023
50%        92.652344
75%       173.497070
max      3839.463867
Name: size_mb, dtype: float64
# 根据价格新增标签
app['paid'] = app['price'].apply(lambda x: 1 if x > 0 else 0)
#lambda阐述规则,X为price,为paid赋值,即当price>0,paid为1,其他情况下,paid为0
app.paid.describe()
count    7197.000000
mean        0.436432
std         0.495977
min         0.000000
25%         0.000000
50%         0.000000
75%         1.000000
max         1.000000
Name: paid, dtype: float64
# 该部分小结,初步完成数据清洗
#清洗异常值(unamed)
#给分析造成难度的值(size-bytes)
#核心变量的创建(免费/收费)
#value_counts (price,prime_genre)
#value_Coutn只能对应series,不能对整个dataframe做操作
app.price.value_counts()    #每一种价格对应的app数量
0.00      4056
0.99       728
2.99       683
1.99       621
4.99       394
3.99       277
6.99       166
9.99        81
5.99        52
7.99        33
14.99       21
19.99       13
8.99         9
24.99        8
13.99        6
11.99        6
29.99        6
12.99        5
15.99        4
59.99        3
17.99        3
22.99        2
23.99        2
20.99        2
27.99        2
16.99        2
49.99        2
39.99        2
74.99        1
18.99        1
34.99        1
99.99        1
299.99       1
47.99        1
21.99        1
249.99       1
Name: price, dtype: int64
#删除价格大于等于49.99的app
app=app[app['price']<=49.99]
#数据的快速分组
bins = [0,2,10,300]
labels = [  '<2', '<10','<300']
app['price_new']=pd.cut(app.price, bins, right=False, labels=labels)
app.groupby(['price_new'])['price'].describe()   #等级价格的分布情况
countmeanstdmin25%50%75%max
price_new
<25405.00.3619810.6753180.000.000.000.001.99
<101695.04.5658111.8640342.992.993.994.999.99
<30090.020.2566678.24593911.9914.9917.9923.9949.99
# groupby的操作,不同类别app的价格分布
app.groupby(['prime_genre'])['price'].describe()
countmeanstdmin25%50%75%max
prime_genre
Book112.01.7905363.3422100.00.00.002.9927.99
Business56.04.1364297.1544030.00.02.994.9949.99
Catalogs10.00.7990002.5266600.00.00.000.007.99
Education449.02.5720042.6695390.00.02.992.9924.99
Entertainment535.00.8897011.4540220.00.00.001.999.99
Finance104.00.4211541.1089900.00.00.000.005.99
Food & Drink63.01.5523813.9721190.00.00.001.4927.99
Games3862.01.4329232.4866090.00.00.001.9929.99
Health & Fitness180.01.9164442.0523780.00.01.992.999.99
Lifestyle144.00.8854171.4784100.00.00.001.244.99
Medical23.08.77608710.7882690.00.03.9916.9934.99
Music138.04.8354358.9156670.00.00.994.9949.99
Navigation45.02.5500004.4875840.00.00.992.9920.99
News75.00.5177331.1277710.00.00.000.003.99
Photo & Video349.01.4732952.2807030.00.00.991.9922.99
Productivity177.03.7901134.9657770.00.01.994.9929.99
Reference64.04.8368758.2851000.00.01.994.9947.99
Shopping122.00.0163110.1801660.00.00.000.001.99
Social Networking167.00.3398801.1422100.00.00.000.009.99
Sports114.00.9530702.4190840.00.00.000.9919.99
Travel81.01.1203702.1837720.00.00.000.999.99
Utilities248.01.6476212.6285410.00.00.991.9924.99
Weather72.01.6054171.8313160.00.00.992.999.99
app.rating_count_tot.describe()  #用户评价数据分析
count    7.190000e+03
mean     1.290515e+04
std      7.577526e+04
min      0.000000e+00
25%      2.725000e+01
50%      3.005000e+02
75%      2.796750e+03
max      2.974676e+06
Name: rating_count_tot, dtype: float64
#对用户打分的分组
bins = [0,1000,5000,100000,5000000]
app['rating_new']=pd.cut(app.rating_count_tot, bins, right=False)
#用户打分和价格的关系
app.groupby(['rating_new'])['price'].describe()
countmeanstdmin25%50%75%max
rating_new
[0, 1000)4587.01.7986963.3246820.00.00.02.9949.99
[1000, 5000)1193.01.7407213.2038530.00.00.02.9939.99
[5000, 100000)1192.00.9635491.9848950.00.00.00.9914.99
[100000, 5000000)218.00.1963760.9251600.00.00.00.007.99
#可视化部分
import matplotlib.pyplot as plt
import seaborn as sns  #图形可视化工具包
%matplotlib inline
#app评分关系
plt.figure(figsize=(30,20))#调整大小
sns.relplot(x="prime_genre", y="user_rating",kind='line',
              data=app) #折线图
<seaborn.axisgrid.FacetGrid at 0x197e75416d8>




<Figure size 2160x1440 with 0 Axes>

[外链图片转存失败(img-LzXYdota-1567910285388)(output_20_2.png)]

app1=app[app['price']<=9.99]
#直方图,APP价格的分布
sns.distplot(app1['price'])
<matplotlib.axes._subplots.AxesSubplot at 0x197e7afd4e0>

[外链图片转存失败(img-WfQ8DFMH-1567910285389)(output_22_1.png)]

#业务问题2:收费app的价格分布是如何的?不同类别之间有关系吗?

#箱线图,不同类别APP价格
plt.figure(figsize=(10,8))#调整大小
sns.boxplot(x='price',y='prime_genre',data=app[app['paid']==1])

#业务解答:价格绝大部分都集中在9.99美元以内,个别类别(如医疗)等因专业性总体价格会高于其他类别
<matplotlib.axes._subplots.AxesSubplot at 0x197e7905320>

[外链图片转存失败(img-33bXiSPT-1567910285389)(output_23_1.png)]

#只保留五个类别数据
top5= ['Games','Entertainment', 'Education', 'Photo & Video',
       'Utilities']
app5 = app[app.prime_genre.isin(top5)]
#箱线图,前五个类别的app价格

plt.figure(figsize=(10,8))#调整大小
sns.boxplot(x='price',y='prime_genre',data=app5[app['paid']==1])
C:\Anaconda3\lib\site-packages\ipykernel_launcher.py:4: UserWarning: Boolean Series key will be reindexed to match DataFrame index.
  after removing the cwd from sys.path.





<matplotlib.axes._subplots.AxesSubplot at 0x197e97f3518>

[外链图片转存失败(img-T0v4L4cF-1567910285390)(output_25_2.png)]

#散点图,价格和用户评分的分布
sns.scatterplot(x='price',y='user_rating',data=app)
<matplotlib.axes._subplots.AxesSubplot at 0x197e81ae710>

[外链图片转存失败(img-cptlYvri-1567910285391)(output_26_1.png)]

#只保留五个类别数据
top5= ['Games','Entertainment', 'Education', 'Photo & Video',
       'Utilities']
app5 = app[app.prime_genre.isin(top5)]
#柱状图,前5个类别app的用户评分均值
#同一类别,将免费和付费的评分进行对比
plt.figure(figsize=(10,8))
sns.barplot(x='prime_genre',y='user_rating',hue='paid',data=app5)   #hue 做类别区分
<matplotlib.axes._subplots.AxesSubplot at 0x197e7fece48>

[外链图片转存失败(img-wJvmSLRL-1567910285392)(output_28_1.png)]

#业务问题1 免费或收费APP集中在哪些类别
#第一步,将数据加总成每个类别有多少个app
#第二步,从高到低进行排列
#第三步,将数据进行可视化

#使用countplot--count是对数据加总,plot将数据进行可视化
# hue='paid' 对类别进行paid分组
#使用order对数据进行排序(从大到小)

plt.figure(figsize=(20,10))
sns.countplot(y='prime_genre',hue='paid',data=app,order=app['prime_genre'].value_counts().index)
plt.tick_params(labelsize=20)    #调整文字大小

#业务解答:都是高度集中在游戏类别
---------------------------------------------------------------------------

NameError                                 Traceback (most recent call last)

<ipython-input-1-1652bf40fd57> in <module>()
      8 #使用order对数据进行排序(从大到小)
      9 
---> 10 plt.figure(figsize=(20,10))
     11 sns.countplot(y='prime_genre',hue='paid',data=app,order=app['prime_genre'].value_counts())
     12 plt.tick_params(labelsize=20)    #调整文字大小


NameError: name 'plt' is not defined
#免费与收费的APP在不同评分区间的分布
bins=[0,0.1,2.5,4.5,5]
app['rating_level']=pd.cut(app.user_rating,bins,right=False)
app.groupby(['rating_level'])['user_rating'].describe()
countmeanstdmin25%50%75%max
rating_level
[0.0, 0.1)929.00.0000000.0000000.00.00.00.00.0
[0.1, 2.5)206.01.6504850.4002131.01.52.02.02.0
[2.5, 4.5)2903.03.6460560.4679872.53.54.04.04.0
[4.5, 5.0)2660.04.5000000.0000004.54.54.54.54.5
sns.countplot(x='paid',hue='rating_level',data=app)
<matplotlib.axes._subplots.AxesSubplot at 0x197e9577f28>

[外链图片转存失败(img-CkbAcoRt-1567910285393)(output_32_1.png)]

#业务问题3:APP的大小和用户评分之间有关系吗?
q4=['user_rating','price','size_mb']
app[q4].corr()   #计算相关性(R值)
user_ratingpricesize_mb
user_rating1.0000000.0732370.066160
price0.0732371.0000000.314386
size_mb0.0661600.3143861.000000
#业务解答:大小价格都不和评分没有直接关系,但是价格和大小之间有正相关关系
sns.heatmap(app[q4].corr())
#热力图,展现变量之间两两之间关系的强弱
<matplotlib.axes._subplots.AxesSubplot at 0x197e95ce6d8>

[外链图片转存失败(img-D8Esx83k-1567910285394)(output_36_1.png)]

<think>好的,用户想进行应用程序客户投诉的数据分析,询问方法、工具和流程。我需要结合之前的引用内容,尤其是引用2中的运营商投诉分析方法,还有引用4中的数据驱动决策。首先,用户需要明确分析目标,比如定位问题还是预警。然后数据采集,可能包括结构化和非结构化数据,比如日志和文本。接着数据清洗,处理缺失值和重复数据。然后是分析方法,可能需要分类、文本挖掘或者聚类,引用2提到了跨域融合数据,可能需要结合用户行为数据。工具方面,Excel、Python、Tableau这些常见工具应该够用。流程上,从目标到数据准备、分析、洞察、报告和闭环。另外,用户可能需要知道如何分组测试或者用漏斗分析,引用3提到了AB实验和漏斗图,可能在优化阶段有用。最后要确保建议具体,结合案例,比如文本分析找出高频词,或者构建预警模型。还要注意用户可能没有提到的深层需求,比如实时分析或者自动化报告,这些可以作为优化建议提到。</think>### App客户投诉数据分析方法 #### 一、分析框架设计 1. **明确分析目标** - 问题定位型分析:识别高频投诉类型(如支付失败、闪退等)及其根因[^2] - 趋势预警型分析:构建投诉量预测模型,设置阈值触发预警 - 用户体验优化:结合用户行为数据(如操作路径、停留时长)分析投诉关联性[^3] 2. **数据采集维度** - 结构化数据:用户属性(设备型号、OS版本)、投诉类型、处理时效 - 非结构化数据:投诉文本描述、客服对话记录 - 补充数据源:应用崩溃日志、版本更新记录、营销活动时间轴 ```python # 数据集成示例(Pandas) import pandas as pd complaints = pd.read_csv('complaints.csv') crash_logs = pd.read_json('crash_logs.json') user_behavior = pd.read_sql('SELECT * FROM user_actions', con=engine) merged_data = pd.merge(complaints, crash_logs, on='session_id', how='left') ``` #### 二、核心分析方法 1. **多维下钻分析** - 使用帕累托分析确定Top20%关键投诉类型 - 版本维度对比:$$ \frac{投诉量_v}{活跃用户数_v} \times 100\% $$ - 设备维度异常检测:计算Z-score $$ Z = \frac{x - \mu}{\sigma} $$ 2. **文本挖掘技术** - 应用TF-IDF算法提取关键词:$$ \text{TF-IDF}(t,d) = \text{TF}(t,d) \times \text{IDF}(t) $$ - 构建LDA主题模型发现潜在投诉模式 - 情感分析判断用户情绪强度(使用VADER或BERT模型) 3. **预测模型构建** 采用XGBoost构建投诉预警模型: $$ \hat{y} = \sum_{k=1}^K f_k(x_i), \quad f_k \in \mathcal{F} $$ 特征工程包含: - 用户历史投诉次数 - 最近版本更新变动度 - 同类用户平均投诉率 #### 三、工具选型建议 | 分析阶段 | 推荐工具 | 典型应用场景 | |----------------|------------------------------|------------------------------| | 数据清洗 | Python(pandas)、OpenRefine | 处理缺失值、异常值标准化 | | 可视化分析 | Tableau、Power BI | 构建投诉趋势仪表盘 | | 文本分析 | Jupyter Notebook(NLTK,gensim)| 投诉内容主题聚类 | | 预测建模 | Python(scikit-learn,XGBoost) | 投诉量时间序列预测 | #### 四、实施流程 1. **数据准备阶段**(2-3天) - 建立数据血缘图谱,确认各系统数据更新时间窗口 - 开发ETL脚本实现自动化数据管道 2. **探索性分析**(3-5天) - 制作投诉地理热力图 - 绘制版本迭代与投诉量相关性矩阵 3. **深度建模**(1-2周) - 构建用户投诉倾向评分- 开发实时投诉监控API接口 4. **成果落地**(持续迭代) - 将预警模型集成到客服工单系统 - 建立AB测试机制验证优化方案效果 #### 五、关键成功要素 1. 建立跨部门数据协同机制(产品、运营、技术团队)[^2] 2. 设置数据质量监控看板,确保投诉分类准确性>95% 3. 采用渐进式分析策略,优先解决影响80%用户体验的关键问题[^4]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值