Skip to main content
QUICK REVIEW

[Paper Review] waywiser: Ergonomic Methods for Assessing Spatial Models

M. J. Mahoney|arXiv (Cornell University)|Mar 20, 2023
demographic modeling and climate adaptationDecision Sciences4 citations
TL;DR

The paper introduces the R package waywiser, which provides a unified, ergonomic interface for assessing spatial predictive models. It standardizes model evaluation across metrics, spatial autocorrelation, multi-scale aggregation, and applicability domains—offering consistent, type- and size-stable outputs that integrate seamlessly with the tidymodels ecosystem, improving reproducibility and reducing cognitive load in spatial modeling workflows.

ABSTRACT

Assessing predictive models can be challenging. Modelers must navigate a wide array of evaluation methodologies implemented with incompatible interfaces across multiple packages which may give different or even contradictory results, while ensuring that their chosen approach properly estimates the performance of their model when generalizing to new observations. Assessing models fit to spatial data can be particularly difficult, given that model errors may exhibit spatial autocorrelation, model predictions are often aggregated to multiple spatial scales by end users, and models are often tasked with generalizing into spatial regions outside the boundaries of their initial training data. The waywiser package for the R language attempts to make assessing spatial models easier by providing an ergonomic toolkit for model evaluation tasks, with functions for multiple assessment methodologies sharing a unified interface. Functions from waywiser share standardized argument names and default values, making the user-facing interface simple and easy to learn. These functions are additionally designed to be easy to integrate into a wide variety of modeling workflows, accepting standard classes as inputs and returning size- and type-stable outputs, ensuring that their results are of consistent and predictable data types and dimensions. Additional features make it particularly easy to use waywiser along packages and workflows in the tidymodels ecosystem.

Motivation & Objective

  • To address the challenge of inconsistent, fragmented interfaces across spatial model evaluation tools in R.
  • To reduce cognitive load and methodological errors in model assessment by providing a consistent, ergonomic interface for diverse evaluation methods.
  • To enable reliable, scalable assessment of spatial models across multiple spatial scales and applicability domains.
  • To ensure type- and size-stable outputs that integrate smoothly with existing R modeling workflows, especially within the tidymodels ecosystem.
  • To support both local and global spatial autocorrelation diagnostics and multi-scale performance evaluation for improved model validation.

Proposed method

  • The package implements standardized functions for common model assessment metrics (e.g., RMSE, Willmott’s d1) with consistent argument names and default values.
  • It provides wrappers for spatial autocorrelation statistics (e.g., Moran’s I, Geary’s c) using both global and local variants, with outputs aligned to input data structure.
  • The ww_multi_scale() function enables performance evaluation across multiple spatial aggregation scales using regular polygon grids, with customizable grid resolution and metric sets.
  • It integrates with the sf package for spatial data and supports data frames/vectors for non-spatial inputs, ensuring compatibility with standard R modeling pipelines.
  • The package is designed to interoperate with tidymodels tools like rsample, spatialsample, tune, and dials for cross-validation and hyperparameter tuning.
  • All functions return predictable, stable outputs (e.g., tibbles with one row per metric or one row per observation), enhancing programmatic usability.
Figure 1: Automatically calculated spatial neighbors for departments of France. Lines between department centroids indicate a neighbor relationship.
Figure 1: Automatically calculated spatial neighbors for departments of France. Lines between department centroids indicate a neighbor relationship.

Experimental results

Research questions

  • RQ1How can a unified, ergonomic interface improve the usability and consistency of spatial model evaluation in R?
  • RQ2To what extent do standardized argument names and stable outputs reduce errors and cognitive load in model assessment workflows?
  • RQ3How well does the package support multi-scale performance evaluation of spatial models across different aggregation levels?
  • RQ4Can the package effectively integrate with the tidymodels ecosystem for automated model tuning and cross-validation?
  • RQ5How do local and global spatial autocorrelation metrics help diagnose model misspecification in spatial prediction models?

Key findings

  • The waywiser package successfully standardizes model assessment across multiple methodologies, including metrics, spatial autocorrelation, and multi-scale evaluation, using a consistent interface.
  • The ww_multi_scale() function enables reliable performance evaluation at multiple spatial scales, with results showing varying RMSE and Willmott’s d1 values across 2×2, 5×5, and 10×10 grids.
  • Local Moran’s I and Geary’s c statistics identified spatial clustering of residuals in southern India, with additional hotspots in southeastern Asia, western Africa, and South America.
  • The global Geary’s c value was calculated as 0.159, indicating strong spatial autocorrelation in model residuals, suggesting model misspecification.
  • All functions in waywiser return type- and size-stable outputs (e.g., tibbles), ensuring predictable behavior in programmatic workflows and seamless integration with tidymodels.
  • The package enables smooth integration with rsample, spatialsample, tune, and dials, supporting cross-validated model assessment and hyperparameter optimization.
Figure 2: Automatically calculated spatial neighbors for points from the WorldClim simulation data. Lines between points indicate a neighbor relationship.
Figure 2: Automatically calculated spatial neighbors for points from the WorldClim simulation data. Lines between points indicate a neighbor relationship.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.