bootstrap never resamples an objective = expression fit's data: every replicate refits the full data set
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start in pybnf/pybnf.py at _run_bootstrapping, then read ExpressionModel._score_data_bound and the CallableModel handling in pybnf/analytical_model.py to understand why these objectives ignore resampling weights. Add a load-time refusal for bootstrap with expression and callable objectives, with a clear reason, and add a test confirming both cases are rejected.
由索引模型根据 Issue 内容生成。
描述
bootstrap = N with objective = expression runs N replicate fits and writes Results/bootstrapped_parameter_sets.txt, but it never resamples the data. Every replicate refits the full data set, so the spread across replicates is optimizer noise, not sampling uncertainty. The run finishes normally and gives no sign of this.
Reproduce
Eight points on a line, bound with data = line.exp:
# time x y
0 0.0 1.470858
1 1.0 2.301711
2 2.0 4.660143
3 3.0 7.185252
4 4.0 8.491826
5 5.0 10.963940
6 6.0 13.089598
7 7.0 14.584450
edition = 2
objective = expression
data = line.exp
expression = 0.5*((y - (m*x + c))/0.5)^2
uniform_var = m -10 10
uniform_var = c -10 10
random_seed = 3
job_type = de
population_size = 20
max_iterations = 60
bootstrap = 4
output_dir = out_bootdata
Results/bootstrapped_parameter_sets.txt:
# Simulation Obj c m
bootstrap_run_0 2.156855947419871 0.9285078460533689 1.9757843379025064
bootstrap_run_1 2.156952291747472 0.9286902927768879 1.9750473817283134
bootstrap_run_2 2.1569116731401587 0.9318778882219917 1.9752230545988616
bootstrap_run_3 2.1569619899908914 0.9326477250530382 1.9752196268812727
Comparison by hand
Computed by hand with plain least squares, without PyBNF:
- The full-data fit is m = 1.975626, c = 0.928783, objective = 2.156853. Every replicate above is that fit, to optimizer precision.
- A case-resampling bootstrap of these 8 points, 4000 replicates, gives SD(m) = 0.073 and SD(c) = 0.33.
- The four replicates spread by about 0.0004 in m and 0.002 in c, roughly 100 times too narrow.
No *_weights_*.txt file is written. The bound data never reach alg.exp_data, which is where _run_bootstrapping (pybnf/pybnf.py) draws the resampling weights. And ExpressionModel._score_data_bound (pybnf/analytical_model.py) sums the expression over every row of every bound experiment with no weights, so it would ignore them even if they were drawn.
Related cases
objective = expressionwith nodataat all, plusbootstrap, is also accepted and producesbootstrap_run_Nrows. There is nothing to resample, so these are only refits from different seeds.objective = callablehands the callable the whole unweighteddatamap (CallableModel, pybnf/analytical_model.py). By reading the code, it has the same problem. I did not run it.
Expected
Refuse bootstrap at load for objective = expression and objective = callable, naming the reason. The one alternative is to implement row weights for the data-bound expression, whose objective is a per-row sum, so that it can be resampled. A callable cannot be resampled from outside. The refusal needs a test.
Found during the review of #984.
- 主要语言
- Python
- 星标
- 25
- 派生
- 25
- 平均合并
- 4 小时 5 分钟
- 30 天内合并 PR
- 10
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
lanl/PyBNF 的其他 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
bug minor
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
bug tech debt
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
bug minor
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
bug silent-incorrectness
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
相似的 Issue
-
cron: raise a distinct error when next_fire finds no match in its search bound (from #813 item 5)未关闭
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
Pin Hugging Face commit revisions for AuK weight downloads and eliminate post-download SHA TOCTOU未关闭area:voice better-dependency-freedom dependencies effort:low in-progress model:medium plan planner:gemini-4-neon-high priority:2 security
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
needs-area-label
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
OpenFreeEnergy/openfe#2371 ·
维护者通常 2 天内回复
-
HMDB's smiles file writes "None" for metabolites with an empty <smiles/> (file not currently used)未关闭
难度 2/5 1-3 小时 新手友好度 80/100
NCATSTranslator/Babel#1269 ·
维护者通常 1 天内回复