Refactor: consistent naming across functions, targets, and pkgdown

Functions: prepare_eda_recipe -> build_eda_recipe,
           create_efficiency_plot -> plot_efficiency,
           format_class_imbalance_tourney_gt -> format_tournament_gt

Targets: model_inputs_prefix -> baf_model_input_prefix,
         tbl_fraud_by_month_data -> fraud_by_month_summary,
         model_diag -> diag_fit, winning_params -> best_params,
         production_recipe_blueprint -> prod_recipe,
         final_eval_data -> test_predictions

pkgdown: restructured reference index into 6 logical sections,
         removed stale names and development comments.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-22 03:52:34 -05:00
parent f47b2e1be2
commit b38892f49e
7 changed files with 159 additions and 212 deletions

View File

@@ -580,9 +580,9 @@ run_imbalance_tournament <- function(
return(results_df)
}
#' Format Class Imbalance Tournament Table
#' Format Tournament Results Table
#'
#' Aggregates results from the model tournament and performs paired t-tests
#' Aggregates results from the model tournament and performs paired t-tests
#' against the 'Standard' model to determine statistical significance.
#'
#' @param results_df The tibble output from `run_imbalance_tournament`.
@@ -593,7 +593,7 @@ run_imbalance_tournament <- function(
#'
#' @return A formatted gt table object.
#' @export
format_class_imbalance_tourney_gt <- function(results_df) {
format_tournament_gt <- function(results_df) {
# Extract scores for the 'Standard' recipe to use as the baseline for t-tests
standard_scores <- results_df |>
@@ -648,12 +648,12 @@ format_class_imbalance_tourney_gt <- function(results_df) {
)
}
#' Create Effectiveness vs Efficiency Plot
#' Plot Effectiveness vs Efficiency
#' @param results_df Tibble from run_imbalance_tournament
#' @importFrom ggplot2 ggplot aes geom_point scale_color_manual labs theme_minimal
#' @importFrom ggrepel geom_text_repel
#' @importFrom cowplot theme_half_open background_grid
create_efficiency_plot <- function(results_df) {
plot_efficiency <- function(results_df) {
# Aggregate by recipe
plot_data <- results_df |>
dplyr::group_by(recipe) |>
@@ -677,11 +677,11 @@ create_efficiency_plot <- function(results_df) {
cowplot::theme_half_open(font_family = "Atkinson Hyperlegible") +
cowplot::background_grid(major = "y")
}
#' Prepare EDA Recipe
#' Build EDA Recipe
#' @param eda_data Raw EDA data
#' @importFrom recipes recipe update_role step_novel step_unknown step_impute_median step_dummy all_nominal_predictors all_numeric_predictors prep
#' @export
prepare_eda_recipe <- function(eda_data) {
build_eda_recipe <- function(eda_data) {
recipe(outcome ~ ., data = eda_data) |>
update_role(month, new_role = "ID") |>
step_novel(all_nominal_predictors()) |>