hardhat

Installation
SKILL.md

Creating Modeling Packages with hardhat

The hardhat package provides infrastructure for building modeling packages with consistent interfaces. It standardizes preprocessing via mold() (training) and forge() (prediction), handling formula, XY, and recipe inputs uniformly.

Quick Reference

Task Function
Preprocess training data mold(x, y) or mold(formula, data)
Preprocess prediction data forge(new_data, blueprint)
Create model object new_model(..., blueprint, class)
XY blueprint default_xy_blueprint(intercept = TRUE)
Formula blueprint default_formula_blueprint(intercept = TRUE)
Recipe blueprint default_recipe_blueprint(intercept = TRUE)
Format numeric predictions spruce_numeric(pred)
Format class predictions spruce_class(pred)
Format probability predictions spruce_prob(pred)
Validate univariate outcome validate_outcomes_are_univariate(outcomes)
Validate prediction size validate_prediction_size(pred, new_data)
Related skills
Installs
11
GitHub Stars
10
First Seen
Feb 26, 2026