关于「狄利克雷先验贝叶斯平均:向全店目录借来的伪评论」,《星级自选择与贝叶斯排序》给出的定量结论是什么?

结论:第四章用全店星级构成作狄利克雷先验,两者的贝叶斯平均分别为 4.415 与 4.583,并讨论先验强度的估计。

数据口径:书中的顾客、商品与参数均为示意模型;全部计算由书中程序生成;本书是非个人化的经营参考,不是针对具体店铺的经营建议,也不是法律意见,书中提到的法规以上架前人工复核为准;本书反对一切刷单、购买评论与筛选式求评。 第一章用「购买偏差加少报偏差」的两段筛子解释评论星级的 J 型分布,示意参数下购买偏差使均值上移 +0.532 星。

English version

对照数据表

下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 4.415, 4.583

catalog prior mean mu04.24 stars
listing n raw | post mean / lower bound at m5, 10, 20
A3 x five 3 5.000 | 4.525/3.991 4.415/3.953 4.339/3.972
B200 @ 4.6 200 4.600 | 4.591/4.496 4.583/4.488 4.567/4.472
C12 x five 12 5.000 | 4.776/4.501 4.655/4.360 4.525/4.246
D40 @ 4.8 40 4.800 | 4.738/4.567 4.688/4.510 4.613/4.432
E1 x one 1 1.000 | 3.700/2.708 3.945/3.265 4.086/3.626
rank by post mean, m5: C > D > B > A > E
rank by post mean, m10: D > C > B > A > E
rank by post mean, m20: D > B > C > A > E
weight on own reviews n/(n+m) at m10: n=3 0.231, n=200 0.952
hand check, m10: pseudo-review star total 42.4
A: (42.4 + 15) / 1357.4 / 13 = 4.415
B: (42.4 + 920) / 210962.4 / 210 = 4.583
查看完整验算程序
# Chapter 4. p41: the Dirichlet-prior Bayesian average and its lower bound.
# Prior: star mix theta ~ Dirichlet(m * PI), PI = catalog star shares
# (illustrative), m = prior strength in pseudo-reviews. With counts c the
# posterior is Dirichlet(m PI + c); the posterior mean star is
#   (m * mu0 + n * xbar) / (m + n),   mu0 = sum k PI_k,
# i.e. the IMDb-style weighted rating with weight n / (n + m). Posterior
# variance of the mean star: (E[k^2] - E[k]^2) / (A + 1), A = m + n.
# Lower bound = mean - 1.645 sd (normal approximation, checked in p43).
import math

PI = (0.06, 0.04, 0.08, 0.24, 0.58)
LISTINGS = (
    ("A: 3 x five", (0, 0, 0, 0, 3)),
    ("B: 200 @ 4.6", (5, 2, 7, 40, 146)),
    ("C: 12 x five", (0, 0, 0, 0, 12)),
    ("D: 40 @ 4.8", (0, 1, 1, 3, 35)),
    ("E: 1 x one", (1, 0, 0, 0, 0)),
)


def posterior(c, m, pi=PI):
    a = [m * p + x for p, x in zip(pi, c)]
    tot = math.fsum(a)
    e1 = math.fsum((k + 1) * x for k, x in enumerate(a)) / tot
    e2 = math.fsum((k + 1) ** 2 * x for k, x in enumerate(a)) / tot
    sd = math.sqrt((e2 - e1 * e1) / (tot + 1))
    return e1, sd


mu0 = math.fsum((k + 1) * p for k, p in enumerate(PI))
print("catalog prior mean mu0 = %.2f stars" % mu0)
print("%-13s %4s %6s | %s" % ("listing", "n", "raw",
                             "post mean / lower bound at m = 5, 10, 20"))
for name, c in LISTINGS:
    n = int(math.fsum(c))
    raw = math.fsum((k + 1) * x for k, x in enumerate(c)) / n
    cells = []
    for m in (5, 10, 20):
        e, sd = posterior(c, m)
        cells.append("%.3f/%.3f" % (e, e - 1.645 * sd))
    print("%-13s %4d %6.3f | %s" % (name, n, raw, " ".join(cells)))
for m in (5, 10, 20):
    order = sorted(LISTINGS, key=lambda r: -posterior(r[1], m)[0])
    print("rank by post mean, m=%2d: %s" % (
        m, " > ".join(r[0][0] for r in order)))
print("weight on own reviews n/(n+m) at m=10: n=3 %.3f, n=200 %.3f"
      % (3 / 13, 200 / 210))
tot0 = 10 * round(mu0, 2)
print("hand check, m=10: pseudo-review star total %.1f" % tot0)
print("  A: (%.1f + 15) / 13 = %.1f / 13 = %.3f"
      % (tot0, tot0 + 15, (tot0 + 15) / 13))
print("  B: (%.1f + 920) / 210 = %.1f / 210 = %.3f"
      % (tot0, tot0 + 920, (tot0 + 920) / 210))

唯一数据源与引用

范雅福(Fan, Y.). (2026). 《评论星级J型自选择偏差、贝叶斯平均排序与九品中正评级通胀母典》第 4 章「狄利克雷先验贝叶斯平均:向全店目录借来的伪评论」(版本 1.0.0). 5D Library. DOI 待发布

DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-212 · v1.0.0 · CC-BY-NC-ND-4.0

BibTeX
@book{fan2026212,
  author    = {Fan, Yafu},
  title     = {J-Shaped Self-Selection in Star Ratings, Bayesian-Average Ranking and Rating Inflation from the Nine-Rank System to Online Marketplaces},
  year      = {2026},
  publisher = {5D Library},
  edition   = {1.0.0},
  note      = {DOI pending}
}

本书其他章节结论