Package: hardhat 1.4.3.9000

Hannah Frick

hardhat: Construct Modeling Packages

Building modeling packages is hard. A large amount of effort generally goes into providing an implementation for a new method that is efficient, fast, and correct, but often less emphasis is put on the user interface. A good interface requires specialized knowledge about S3 methods and formulas, which the average package developer might not have. The goal of 'hardhat' is to reduce the burden around building new modeling packages by providing functionality for preprocessing, predicting, and validating input.

Authors:Hannah Frick [aut, cre], Davis Vaughan [aut], Max Kuhn [aut], Posit Software, PBC [cph, fnd]

hardhat_1.4.3.9000.tar.gz
hardhat_1.4.3.9000.zip(r-4.7)hardhat_1.4.3.9000.zip(r-4.6)hardhat_1.4.3.9000.zip(r-4.5)
hardhat_1.4.3.9000.tgz(r-4.6-any)hardhat_1.4.3.9000.tgz(r-4.5-any)
hardhat_1.4.3.9000.tar.gz(r-4.7-any)hardhat_1.4.3.9000.tar.gz(r-4.6-any)
hardhat_1.4.3.9000.tgz(r-4.6-emscripten)
manual.pdf |manual.html
DESCRIPTION |NEWS
card.svg |card.png
hardhat/json (API)

# Install 'hardhat' in R:
install.packages('hardhat', repos = c('https://tidymodels.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/tidymodels/hardhat/issues

Pkgdown/docs site:https://hardhat.tidymodels.org

Datasets:

On CRAN:

Conda:

14.88 score 108 stars 493 packages 248 scripts 165k downloads 85 exports 11 dependencies

Last updated from:946e77cd74. Checks:9 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-x86_64OK288
source / vignettesOK204
linux-release-x86_64OK155
macos-release-arm64OK98
macos-oldrel-arm64OK134
windows-develOK141
windows-releaseOK118
windows-oldrelOK126
wasm-releaseOK133

Exports:add_intercept_columncheck_column_namescheck_no_formula_duplicationcheck_outcomes_are_binarycheck_outcomes_are_factorscheck_outcomes_are_numericcheck_outcomes_are_univariatecheck_prediction_sizecheck_predictors_are_numericcheck_quantile_levelscontr_one_hotcreate_modeling_packagedefault_formula_blueprintdefault_recipe_blueprintdefault_xy_blueprintdelete_responseextract_fit_engineextract_fit_parsnipextract_fit_timeextract_moldextract_parameter_dialsextract_parameter_set_dialsextract_postprocessorextract_preprocessorextract_quantile_levelsextract_recipeextract_spec_parsnipextract_tailorextract_workflowfct_encode_one_hotforgefrequency_weightsget_data_classesget_levelsget_outcome_levelsimportance_weightsimpute_quantilesis_blueprintis_case_weightsis_frequency_weightsis_importance_weightsis_quantile_predmodel_framemodel_matrixmodel_offsetmoldnew_blueprintnew_case_weightsnew_default_formula_blueprintnew_default_recipe_blueprintnew_default_xy_blueprintnew_formula_blueprintnew_frequency_weightsnew_importance_weightsnew_modelnew_recipe_blueprintnew_xy_blueprintquantile_predrecomposerefresh_blueprintrun_forgerun_moldscreamshrinksnapspruce_classspruce_class_multiplespruce_numericspruce_numeric_multiplespruce_probspruce_prob_multiplestandardizetuneupdate_blueprintuse_modeling_depsuse_modeling_filesvalidate_column_namesvalidate_no_formula_duplicationvalidate_outcomes_are_binaryvalidate_outcomes_are_factorsvalidate_outcomes_are_numericvalidate_outcomes_are_univariatevalidate_prediction_sizevalidate_predictors_are_numericweighted_table

Dependencies:cligluelifecyclemagrittrpillarpkgconfigrlangsparsevctrstibbleutf8vctrs

Creating Modeling Packages With hardhat
Introduction | What's Our Model? | Model Fitting | Model Constructor | Model Fitting Implementation | Model Fitting Bridge | User Facing Fitting Function | Adding an Intercept Option | Model Prediction | Prediction Implementation | Prediction Bridge | User Facing Prediction Function | Final Testing

Last update: 2025-04-23
Started: 2019-03-08

Forging data for predictions
Introduction | Connection with mold() | Outcomes | Validation | Column existence | Column types | Lossless conversion | Recipes and forge() | A note on recipes

Last update: 2025-04-23
Started: 2019-02-20

Molding data for modeling
Introduction | A First Example | blueprints | Formulas | Intercepts | Dummy variables | Multivariate outcomes | XY | Vector outcomes | Recipe

Last update: 2025-04-23
Started: 2019-02-20

Readme and manuals

Help Manual

Help pageTopics
Add an intercept column to 'data'add_intercept_column
Default formula blueprintdefault_formula_blueprint mold.formula
Default recipe blueprintdefault_recipe_blueprint mold.recipe
Default XY blueprintdefault_xy_blueprint mold.data.frame mold.matrix
Delete the response from a terms objectdelete_response
Encode a factor as a one-hot indicator matrixfct_encode_one_hot
Forge prediction-ready dataforge
Frequency weightsfrequency_weights
Extract data classes from a data frame or matrixget_data_classes
Extract factor levels from a data frameget_levels get_outcome_levels
Example data for hardhatexample_test example_train hardhat-example-data
Generics for object extractionextract_fit_engine extract_fit_parsnip extract_fit_time extract_mold extract_parameter_dials extract_parameter_set_dials extract_postprocessor extract_preprocessor extract_recipe extract_spec_parsnip extract_tailor extract_workflow hardhat-extract
Importance weightsimportance_weights
Impute additional quantiles from a 'quantile_pred'impute_quantiles
Is 'x' a preprocessing blueprint?is_blueprint
Is 'x' a case weights vector?is_case_weights
Is 'x' a frequency weights vector?is_frequency_weights
Is 'x' an importance weights vector?is_importance_weights
Construct a model framemodel_frame
Construct a design matrixmodel_matrix
Extract a model offsetmodel_offset
Create a modeling packagecreate_modeling_package modeling-usethis use_modeling_deps use_modeling_files
Mold data for modelingmold
Extend case weightsnew_case_weights
Create a new default blueprintnew-default-blueprint new_default_formula_blueprint new_default_recipe_blueprint new_default_xy_blueprint
Create a new preprocessing blueprintnew-blueprint new_blueprint new_formula_blueprint new_recipe_blueprint new_xy_blueprint
Construct a frequency weights vectornew_frequency_weights
Construct an importance weights vectornew_importance_weights
Constructor for a base modelnew_model
Create a vector containing sets of quantilesas.matrix.quantile_pred as_tibble.quantile_pred extract_quantile_levels is_quantile_pred quantile_pred
Refresh a preprocessing blueprintrefresh_blueprint
'forge()' according to a blueprintrun-forge run_forge run_forge.default_formula_blueprint run_forge.default_recipe_blueprint run_forge.default_xy_blueprint
'mold()' according to a blueprintrun-mold run_mold run_mold.default_formula_blueprint run_mold.default_recipe_blueprint run_mold.default_xy_blueprint
Screamscream
Subset only required columnsshrink
Spruce up predictionsspruce spruce_class spruce_numeric spruce_prob
Spruce up multi-outcome predictionsspruce-multiple spruce_class_multiple spruce_numeric_multiple spruce_prob_multiple
Standardize the outcomestandardize
Mark arguments for tuningtune
Update a preprocessing blueprintupdate_blueprint
Ensure that 'data' contains required column namescheck_column_names validate_column_names
Ensure no duplicate terms appear in 'formula'check_no_formula_duplication validate_no_formula_duplication
Ensure that the outcome has binary factorscheck_outcomes_are_binary validate_outcomes_are_binary
Ensure that the outcome has only factor columnscheck_outcomes_are_factors validate_outcomes_are_factors
Ensure outcomes are all numericcheck_outcomes_are_numeric validate_outcomes_are_numeric
Ensure that the outcome is univariatecheck_outcomes_are_univariate validate_outcomes_are_univariate
Ensure that predictions have the correct number of rowscheck_prediction_size validate_prediction_size
Ensure predictors are all numericcheck_predictors_are_numeric validate_predictors_are_numeric
Weighted tableweighted_table