← Back to all sparks
H

hardhat

ANALYTICS
Velocity0.0

Developer toolkit for building consistent modeling packages in R

hardhat keeps adding the contracts tidymodels needs next

tidymodelsr-statsmachine-learninginfrastructureapi-contracts
Current state
hardhat is the infrastructure layer under tidymodels, defining the preprocessing and extraction contracts other packages implement. Its releases read as a list of new generics and vector classes: extract_postprocessor(), extract_fit_time(), extract_tailor(), and a quantile_pred() class for quantile-regression output. The newest release is narrow warning and missing-value handling in mold().
Where it's heading
Each addition here lands ahead of a user-facing feature elsewhere in tidymodels — the postprocessor and tailor generics precede the postprocessing workflow, quantile_pred() precedes quantile prediction in parsnip. The package's own surface stays deliberately small and its cadence follows what the rest of the stack is about to need.
Prediction
Expect further extraction generics and prediction-type classes as tidymodels builds out postprocessing, with hardhat's own API remaining thin.

Recent moves

  1. 4mo ago

    mold() warning and quantile missing-value fixes

    Silences a spurious strings_as_factors warning on recipe objects and improves missing handling in quantile predictions. Cleanup on the quantile work introduced in 1.4.1.

    View source ↗
  2. 11mo ago

    extract_tailor() generic added

    Another extraction contract for the rest of tidymodels to implement, this time for tailor objects. Small in isolation, but it is how postprocessing becomes reachable from a fitted workflow.

    View source ↗
  3. 1y ago

    quantile_pred() class for quantile regression output

    Adds the vector class that quantile predictions travel in, and moves errors onto cli. This is the contract parsnip's quantile-regression support is built on — the capability shows up downstream, not here.

    View source ↗
  4. 2y ago

    extract_postprocessor() and extract_fit_time() generics

    Two more generics defined ahead of their consumers, including the first postprocessing hook. Consistent with hardhat's pattern of landing the contract before the feature.

    View source ↗
  5. 2y ago

    Documentation topic renamed at CRAN's request

    A documentation rename with no code change.

    View source ↗
  6. 3y ago

    Multi-outcome prediction helpers and one-hot factor encoding

    Adds the spruce_*_multiple() family for standardising multi-outcome predictions and fct_encode_one_hot(), plus strings_as_factors control on the recipe blueprint. Broadens what preprocessing blueprints can express.

    View source ↗