使用 Python 的竞争对手价格分析

competitors price analysis using Python

我从 10 多个竞争对手中抓取了一个项目。如何使用 python 统计地找到正常价格、低价和高价?

示例数据:

prices = [34, 33, 33.5, 47 , 33.7, 29, 20, 36, 34, 33,2] 

Numpy 是你的朋友!很难说如何在不了解上下文的情况下计算定价过低和过高,但您可以为此从均值中选择一定数量的标准差。

与正常定价类似,没有上下文很难说,但这里是你如何计算中位数和均值。

我强烈建议您对数据进行一些一般统计分析,看看它的外观 - 分布是什么,是否存在异常值等,然后再从中得出任何结论。我还建议您在基于此做出决定之前想出一个强大的方法来计算 over/underpricing。请以下面的简单示例为例,说明如何在 numpy 中实现统计概念...

import numpy as np

prices = [34, 33, 33.5, 47 , 33.7, 29, 20, 36, 34, 33,2]
mean = np.mean(prices)
median = np.median(prices)
stdev = np.std(prices)

## Let's say you decide more than 1 stdev +- from the mean is over/undepricing
overpricing_threshold = mean + stdev
underpricing_threshold = mean - stdev
print(mean)
print(median)
print(stdev)
print(overpricing_threshold)
print(underpricing_threshold)

我建议使用 Scikit Learn. You could utilize a simple Linear Regressor with your task. Or if you are a bit enthusiastic even an XGBoost Regressor 深入学习基础机器学习就可以了。

用机器学习解决这个问题可以更好地了解什么是“正常价格”。