关于「前注意显著性:让异常自己跳出来,也只让异常跳出来」,《数据后台减负与防呆表单》给出的定量结论是什么?
结论:前注意特征是后台表格里成本最低的力量:一屏里只有一个红格,它不用寻找就会被看见。但这股力量会被花光。颜色最强,必须带备份通道,红绿不得成对使用;长度适合大小,不适合异常;方向与闭合较弱,适合第二层。p33 显示,浅底色与白纸的对比度只在 1.10 到 1.24 之间,能被看见全靠色相,所以最高一层要用深底白字。条件格式分三层:红色只给阳性预测值不低于 0.5 的规则,琥珀给 0.1 到 0.5,其余都用中性标记。在海桥 0.0150 的基础率下,红色规则的阳性似然比要达到 65.7;第一章 p10 现状里的规则都只有个位数。按区间定颜色之后,红行从每天 435 行降到不到 3 行,代价是一半异常要靠颜色以外的手段去抓,这正是第四章要算的账。
数据口径:本书不是会计、审计或法律意见。 书中以标注框区分已发表的证据、可运行的计算、原典与作者的假说,每条假说都写明什么结果会推翻它;原典考辨取唐代刘晏的报数制度,原文只转述大意。
对照数据表
下表数字由本章 Python 程序原样打印,可重新运行复现。 程序只用 Python 标准库与结论吻合的打印值: 0.0150, 0.5, 10, 65.7
| prevalence 0.0150; prior odds 1 | 65.67 |
| target PPV LR+ needed max false-positive rate at sensitivity 0.9 / 0.7 / 0.5 | |
| 0.10 | 7.3 0.1234 / 0.0959 / 0.0685 |
| 0.25 | 21.9 0.0411 / 0.0320 / 0.0228 |
| 0.50 | 65.7 0.0137 / 0.0107 / 0.0076 |
| 0.75 | 197.0 0.0046 / 0.0036 / 0.0025 |
| red rows per screen if a rule meets PPV 0.5 at sensitivity 0.7 | 0.525 |
| p10 rules: sensitivity, false-positive rate, LR+, implied PPV at this prevalence | |
| R1 difference not zero | 0.689 0.120 5.74 0.080 |
| R2 status unchanged 48h | 0.567 0.100 5.67 0.079 |
| R4 new customer | 0.222 0.080 2.78 0.041 |
| R6 note not empty | 0.300 0.040 7.50 0.103 |
查看完整验算程序
# Chapter 3. p31: How strong must a rule's evidence be before it may paint a cell red? Odds form of Bayes.
# Shared sample (p10): 1,200 rows a day, 18 real anomalies, prevalence 0.015, 25 rows a screen.
# posterior odds = prior odds x LR+, with LR+ = sensitivity / false-positive rate. For a target PPV the rule
# needs LR+ >= ((1 - prev) / prev) x (PPV / (1 - PPV)). The rule settings at the bottom are copied from p10
# (probability of firing on a normal row, and on each anomaly type weighted by p10's daily counts).
from fractions import Fraction
ROWS, ANOM, PER_SCREEN = 1200, 18, 25
PREV = Fraction(ANOM, ROWS)
COUNTS = {"A1": 6, "A2": 3, "A3": 4, "A4": 2, "A5": 3}
P10_RULES = [("R1 difference not zero", 0.12, {"A1": 1.0, "A3": 1.0, "A2": 0.3, "A4": 0.3, "A5": 0.3}),
("R2 status unchanged 48h", 0.10, {"A1": 0.5, "A2": 0.5, "A3": 0.5, "A4": 0.5, "A5": 0.9}),
("R4 new customer", 0.08, {"A1": 0.2, "A2": 0.2, "A3": 0.2, "A4": 0.4, "A5": 0.2}),
("R6 note not empty", 0.04, {"A1": 0.3, "A2": 0.3, "A3": 0.3, "A4": 0.3, "A5": 0.3})]
def lr_needed(ppv):
return (1 - PREV) / PREV * ppv / (1 - ppv)
if __name__ == "__main__":
prior = PREV / (1 - PREV)
print(" prevalence {:.4f}; prior odds 1 : {:.2f}".format(float(PREV), float(1 / prior)))
print(" target PPV LR+ needed max false-positive rate at sensitivity 0.9 / 0.7 / 0.5")
for ppv in (Fraction(1, 10), Fraction(1, 4), Fraction(1, 2), Fraction(3, 4)):
need = lr_needed(ppv)
fprs = " / ".join("{:.4f}".format(float(Fraction(s, 10) / need)) for s in (9, 7, 5))
print(" {:10.2f} {:12.1f} {}".format(float(ppv), float(need), fprs))
print(" red rows per screen if a rule meets PPV 0.5 at sensitivity 0.7: {:.3f}".format(
float(PER_SCREEN * PREV * Fraction(7, 10) * 2)))
print(" p10 rules: sensitivity, false-positive rate, LR+, implied PPV at this prevalence")
for name, p0, p1 in P10_RULES:
sens = sum(COUNTS[k] * p1[k] for k in COUNTS) / ANOM
lr = sens / p0
post = float(prior) * lr
print(" {:<24s} {:6.3f} {:6.3f} {:6.2f} {:7.3f}".format(name, sens, p0, lr, post / (1 + post)))唯一数据源与引用
范雅福(Fan, Y.). (2026). 《高密度数据工作台视觉减负、条件格式显著性与零培训防呆表单工程》第 3 章「前注意显著性:让异常自己跳出来,也只让异常跳出来」(版本 0.1.0). 5D Library. DOI 待发布
DOI 待发布 · 专著页正式发布后上线(本站暂无专著页) · 5DL-B-138 · v0.1.0 · CC-BY-NC-ND-4.0
BibTeX
@book{fan2026138,
author = {Fan, Yafu},
title = {Cognitive Unloading of Dense Data Workbenches, Conditional-Format Salience and Zero-Training Error-Proof Form Engineering},
year = {2026},
publisher = {5D Library},
edition = {0.1.0},
note = {DOI pending}
}