Commit Graph

6 Commits

Author SHA1 Message Date
7a1a8e0053 Add Phase 4: code quality, CI/CD, and formatting
- testthat infrastructure with 15 tests covering env-var guards,
  return types for all format/save functions, and spelling
- inst/WORDLIST with 52 domain terms (LightGBM, MinIO, Parquet, etc.)
- Spelling test wired into devtools::test() via test-spelling.R
- styler::style_file() added as step 0 in deploy.R (auto-fixes before ship)
- .gitea/workflows/test.yaml: runs testthat suite on push
- .gitea/workflows/lint.yaml: lychee link check + styler dry-run on push
- Removed internal IP address from comment in train_production_model()
- Language: en-US added to DESCRIPTION

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 04:41:37 -05:00
705b2a13d0 Re-track resources/ as static presentation assets
resources/images/confusion-matrix.png is a static Wikipedia screenshot
used in index.qmd slides -- not a generated artifact, so it belongs
in version control.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 03:57:36 -05:00
e8d2c69f2d Remove generated report artifacts from version control
Add reports/figures/, reports/slides/, reports/tables/ to .gitignore
and untrack previously committed PNGs. These are build artifacts
regenerated by tar_make() and deploy.R.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 03:54:51 -05:00
b38892f49e 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>
2026-02-22 03:52:34 -05:00
f47b2e1be2 Add tune_lgbm() and wire hyperparameter tuning into DAG
Converts scratch/tune_model.R into a pure tune_lgbm() function,
replacing hardcoded winning_params with a fully automated tar_target.
Best params (trees=844, depth=3, lr=0.0204, min_n=389) now flow
reproducibly into evaluate_final_model() and train_production_model().
PR-AUC improved from 0.165 to 0.198.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-22 03:25:35 -05:00
33d0fc31c7 Initial commit: BAF Lakehouse fraud detection pipeline
End-to-end LightGBM fraud detection pipeline built as an R package,
orchestrated by targets with data stored in MinIO via Apache Arrow.
Includes 6-layer Lakehouse architecture, class imbalance tournament,
formally tuned hyperparameters (PR-AUC 0.198), and Quarto RevealJS slides.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-02-21 21:19:09 -05:00