Repository navigation
Validation views: land use cross-tabulation, class exclusion in figure of merit - #57
Merged
Merged
Conversation
…it_v() - db$lulc_crosstab_v(id_period_anterior, id_period_post, id_run_anterior, id_run_post = id_run_anterior): cells by class in one period and another, each period read through its own run's lineage - figure_of_merit_v(exclude_id_lulc = ): ignore cells whose initial or observed class is excluded, e.g. a class whose change is imposed deterministically - get_run_read_expr(): read expression as seen from another run, without changing the active run; used by both views Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019fog72qNWbuSjiGBWuP3np
mmyrte
pushed a commit
to mmyrte/evoland-experiments
that referenced
this pull request
Sep 24, 2026
…licate seeds - allocate each replicate period by period with alloc_clumpy_one_period() and write the observed into/out-of-glacier change onto the simulated map before the next period (apply_deterministic_change(); GloGEM output in 090 later) - revert the fixed set.seed(4555) and the parameter-set-only loop: every replicate is allocated with its own registered seed - the first period reads its potentials from the parameter-set run (use_parent_trans_pot), so replicates of a set share that prediction - figure of merit leaves glacier cells out via figure_of_merit_v(exclude_id_lulc) instead of correcting after the fact; the ensemble null is the replicate mean - pin evoland to the head of ethzplus/evoland-plus#57 (d1ee3cf) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019fog72qNWbuSjiGBWuP3np
mmyrte
commented
Oct 19, 2026
…lbattani-56osfg-crosstab
Replaces get_run_read_expr(), which switched the active run to do the same. Also: say that exclude_id_lulc is decided on the reference run, and let glue_sql() pick the arguments up from the calling frame instead of passing coerced copies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019fog72qNWbuSjiGBWuP3np
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two additions to the validation views, both reading each run through its own lineage.
New:
db$lulc_crosstab_v()lulc_crosstab_v(id_period_anterior, id_period_post, id_run_anterior = <active run>, id_run_post = id_run_anterior)counts cells by their class in one period and in another. It returns the transition matrix in long form (id_lulc_anterior,id_lulc_posterior,n_cells);dcast()gives the matrix form. The same call covers:New:
figure_of_merit_v(exclude_id_lulc = )Ignores cells whose initial or observed class is in
exclude_id_lulc. Use it for a class whose change is imposed deterministically, which would otherwise count as hits by construction. The evoland-experimentsssp-ch/080backcast writes the observed glacier change into each simulated period and needs this to score the model on the rest. Default: nothing is excluded.Refactor
get_run_read_expr(self, table_name, id_run)returns a table's read expression as seen from another run, without changing the active run.figure_of_merit_v()now uses it instead of switching the active run inline.Tests
Added to
test_db_evoland.R, on the six-cell fixture of the figure-of-merit tests:tinytest::build_install_test(): all ok, 630 results. No undeclared globals.🤖 Generated with Claude Code
https://claude.ai/code/session_019fog72qNWbuSjiGBWuP3np
Generated by Claude Code