分群思维(二)基于波士顿矩阵的产品分类

文章介绍了如何使用波士顿矩阵结合Python来对产品进行分类,通过销售增长率和市场占有率两个关键指标,将产品划分为四类,并提供了具体的Python代码示例进行模拟。这种方法也可应用于其他领域的二维指标分类,如渠道分析和产品质量评估。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

分群思维(二)基于波士顿矩阵的产品分类

小P:小H,我们的产品现在越来越多了,有没有好分类方法帮助分类呢

小H:有啊,典型的如波士顿矩阵产品分类法

小P:我就知道你会,给我们讲讲呗~

小H:波士顿矩阵将"销售增长率"和"市场占有率"作为衡量产量的重要因素,组合形成四种产品,也即著名的的波士顿产品分类。img

Python模拟

import faker
import pandas as pd
import seaborn as sns
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import ticker
%matplotlib inline

# 初始化设置
sns.set(style="ticks")
plt.rcParams['axes.unicode_minus']=False # 用来正常显示负号
plt.rcParams['font.sans-serif'] = ['SimHei'] # 用来正常显示中文标签
plt.rcParams['axes.unicode_minus'] = False # 用来正常显示负号
def mat_class(x, y, xmean, ymean):
    '''
    根据特征xy生成四类,其中A类似于明星产品
    '''
    if x>=xmean and y>=ymean:
        cl = 'A'
    elif x>=xmean and y<ymean:
        cl = 'B'
    elif x<xmean and y>=ymean:
        cl = 'C'
    else: 
        cl = 'D'
    return cl
# 生成产品随机数
f = faker.Faker()
product = [f.unique.street_suffix() for i in range(20)] # 随机生成的街道简称替代产品名称
np.random.seed(0)
sales_growth = list(np.random.rand(20))
market_share = list(np.random.rand(20))
df = pd.DataFrame({'product':product, 'sales_growth':sales_growth, 'market_share':market_share})

sales_growth_mean = df['sales_growth'].mean()
market_share_mean = df['market_share'].mean()

df['class'] = df.apply(lambda x: mat_class(x.sales_growth, x.market_share, 
                                           sales_growth_mean, market_share_mean), axis = 1)

df.head()
productsales_growthmarket_shareclass
0Greens0.5488140.978618C
1Park0.7151890.799159A
2Place0.6027630.461479B
3Avenue0.5448830.780529C
4Vista0.4236550.118274D
# 为每个点添加对应的名称
plt.figure(figsize=(10, 8))
# 基础散点图
x, y = df['sales_growth'], df['market_share']
label = df['product']
sns.scatterplot(x=x, y=y, hue="class", data=df)
plt.xlabel('销售增长率'); plt.ylabel('市场占有率')

# 对散点图中的每一个点进行文字标注
for a,b,l in zip(x,y,label):
    plt.text(a, b+0.01, '%s.' % l, ha='center', va='bottom', 
                                             fontsize=12)

# 添加特定分割线
plt.vlines(x=sales_growth_mean, ymin=0, ymax=1,
           colors='red', linewidth=2)
plt.hlines(y=market_share_mean, xmin=0, xmax=1,
           colors='red', linewidth=2)

# # 背景网格
# plt.grid(True)
# 隐去四周的边框线条
sns.despine(trim=True, left=True, bottom=True)
plt.show()

output_5_0

应用

一般基于波士顿矩阵分类衍生出了类似的四象限分析法,将二维指标引申至相关的两个特征。例如通过渠道规模和渠道质量对渠道进行分类;产品功能使用率和次日留存率对产品质量进行分类等。

总结

波士顿矩阵对于二维分类具有很好的指导思想,可扩展性极强

共勉~

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值