Repository navigation
Add coreFraction to the predict covariates, as the fit has it - #51
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
…reFraction, level helper, warnings Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
eliotmcintire
added a commit
that referenced
this pull request
Nov 20, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh
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.
The prediction step now records, for each coarse pixel, how much of it lies in the study core, in the same way the fit does. Without it, the year-level dryness average in the prediction included the surrounding buffer while the fit's did not, which shifted every year's predicted ignitions by the same factor.
Affects:
fireSense_igAndEscapePred_Covariatesgains acoreFractioncolumn (not a covariate); predicted ignitions of fits with a year climate term now use the core pixels only.Depends-on: PredictiveEcology/fireSenseUtils#254
Technical details
Defect:
prepIgAndEscPredictData(fireSense_dataPrepPredict.R, themergePreparedCovs()call, about line 694) built the covariates with nocoreFraction; onlyfireSense_dataPrepFitadds it.fireSenseUtils::yearClimateMeans()therefore averaged buffer pixels in predict and core pixels in the fit.Fix: after the merge,
fireSenseUtils::addCoreFraction()withlist(<year label>),sim$flammableRTM(the raster the coarse covariates are built from),sim$rasterToMatchLargeELFandP(sim)$igAggFactor. That factor is forced to the fit module's value byparamCheckOtherMods(sim, "igAggFactor")(line 472), so it equals the fit'sigAggFactor. The result does not depend on the year, so it is kept inmod(likemod$fuelCovsStatic), keyed byfireSenseUtils::coreFractionKey()(flammable cells, core raster and grid,igAggFactor), and remade whenever the key changes; each year only relabels it.onMissing = "zero": a pixel with no flammable cell gets 0, with one warning that gives the count. A multi-ELF categorical raster or none gives 1. FloorfireSenseUtils >= 0.2.3.9183.Reuses:
fireSenseUtils::addCoreFraction()(moved from fireSense_dataPrepFit in fireSenseUtils#254); new: nothing.fireSense_ignitionPredict:
scaleAsFit()only touches columns the fit scaled (coreFractionis stored unscaled), andxgbFeatureNames()excludes it; a test there runs real boosters on covariates with the extra column.Tests (fireSenseUtils 0.2.3.9183 in a scratch library): full suite branch 419 pass, 0 fail; base 406 pass, 0 fail. New: made once over three years, remade when
flammableRTMorrasterToMatchLargeELFchanges;coreFractionwith no raster (all 1), and with a core/buffer raster (1, 0, 1, 0 on the toy grid), and the fit-style table (addCoreFraction()on the same covariates without the column) gives the same yearly mean as the predict table.Cache keys: this module's code changed, which is part of each cached event's key, so its cached events re-run once. The covariate merge here runs with
useCache = FALSE. I did not run a cache comparison.🤖 Generated with Claude Code
https://claude.ai/code/session_01Lx3DXhXsFis2pbqBTh2PPh