bootstrap never resamples an objective = expression fit's data: every replicate refits the full data set
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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.
- Lingua principale
- Python
- Stelle
- 25
- Fork
- 25
- Merge medio
- 4h 5m
- PR unite (30g)
- 10
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di lanl/PyBNF
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
bug minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
bug tech debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
bug minor
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
bug silent-incorrectness
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
Issue simili
-
eegprep-lean: set channel types from the Zarr group's channel_typeForse già presa @claude l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
sccn/eegprep#668 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Upgrade Django to 5.2.18Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
blacklanternsecurity/bbot#3679 ·
I maintainer di solito rispondono entro 2 giorni
-
Link Checker ReportApertaBot Type: Bug Type: Documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
speakeasy-api/speakeasy#2159 ·
I maintainer di solito rispondono entro 1 giorno