ccfd-project - Complete Reference¶
View code on GitHub Get the Video Course
Progress¶
✅ STEP 1: Load Data
✅ STEP 2: Split Train/Test
✅ STEP 3: Create Pipeline
✅ STEP 4: Train Pipeline
✅ STEP 5: Evaluate & Metrics
✅ STEP 6: Save Pipeline
✅ STEP 7: Save Metrics JSON
All steps complete. This is the final reference version with full docstrings on every function.
What's Different From v7¶
| Aspect | v7 | ccfd-project |
|---|---|---|
| Code | Identical functionality | Identical functionality |
| Docstrings | Minimal | Full docstrings with Args, Returns, examples |
| Purpose | Learning (incremental build) | Reference (production-ready) |
Project Structure¶
ccfd-project/
├── p1_01_generate_initial_dataset.py # Generate synthetic dataset
├── p3_01_train_model_baseline.py # Training script (7 steps)
├── requirements.txt # Python dependencies
└── utils/
├── __init__.py # Package exports
├── data_utils.py # load_data, split_data, create_preprocessor
├── model_utils.py # create_pipeline, save_pipeline
└── metrics_utils.py # print_metrics, save_metrics_json
All Functions¶
data_utils.py¶
| Function | Purpose |
|---|---|
load_ | Load CSV → DataFrame |
get_ | Return categorical + numerical column lists |
split_ | Stratified train/test split with feature info |
create_ | ColumnTransformer (OneHotEncoder + StandardScaler) |
model_utils.py¶
| Function | Purpose |
|---|---|
create_ | Build sklearn Pipeline (preprocessor + model) |
save_ | Save pipeline pickle + metadata JSON |
metrics_utils.py¶
| Function | Purpose |
|---|---|
print_ | Print technical + business metrics |
calculate_ | Compute net benefit, fraud caught/missed |
save_ | Save metrics to results/ as JSON |
How to Run¶
Terminal
cd ccfd-project/
# 1. Generate data
python p1_01_generate_initial_dataset.py
# 2. Train model
python p3_01_train_model_baseline.py
Next Section¶
| Next | Topic | What You'll Do |
|---|---|---|
| 04_02_Inference_API | Serve Predictions | Build FastAPI server, test via browser + scripts |
Prefer to learn by watching?
The video course builds this whole project with you on screen, step by step.
Back to 04 A Train Baseline Model v7 Save Metrics JSON Next: 04 B Inference API
🎉 New Course