Repository navigation
Compare fitted models side by side - #24
Merged
Merged
Conversation
- New sdmApp_compare(): one row per model with the mean and SD of its cross-validated AUC, TSS and Boyce index, its predictors, points, folds and settings, best first. - The Ensemble page has a "Compare models" tab with this table, box plots of the metrics of every fold and the suitability maps side by side (rescaled to 0-1); the R-Code tab records the comparison. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # NEWS.md
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.
Summary
Users fit several methods, but each result lived on its own page, so choosing between models, or deciding which belong in an ensemble, meant clicking back and forth. This PR puts them side by side.
sdmApp_compare(fits, metric = c("auc", "tss", "boyce"))NULLentries (models never fitted) are dropped. Non-fits give an error.App: a "Compare models" tab, first on the Ensemble page
It works before any ensemble is built, and shows:
The R-Code tab writes
sdmApp_compare(list(fit_glm, fit_rf, ...), metric = ...)when the comparison was viewed and at least two models exist.Validation
On 600 Niakhar points with 4 random folds, the table ranks random forest (AUC 0.592, TSS 0.204, Boyce 0.356), then the GLM (0.584 / 0.197 / 0.188), then Bioclim (0.488 / 0.098 / 0.088). The box plots show Bioclim below the others on every metric. I rendered both plots and checked them visually; panel spacing was added so the longitude labels of neighbouring maps don't overlap.
Testing
test-sdmApp_compare.R:lintr::lint_package(): no lints.spelling: no errors.🤖 Generated with Claude Code