W12
Advanced 3 sessions • 6 hours R

Week 12: Capstone Project

In this week

Week 12 Overview
.R
Follow along in RStudioDownload the Week 12 R script — every example ready to run with Ctrl+Enter.
Download R Script

Integrating all R skills into a professional project

Week 12 Overview

This is your chance to demonstrate complete mastery of R data science.

PROJECT GOALS:

  • End-to-end analysis (raw data to insights)
  • Professional quality code
  • Multiple analytical approaches
  • Clear communication
  • Reproducible results
  • Portfolio-worthy deliverable

CAPSTONE WORKFLOW:

WEEK 12 SCHEDULE:

MONDAY-TUESDAY (Days 1-2):

  • Choose dataset (provided or self-selected)
  • Exploratory Data Analysis
  • Initial visualization
  • Data cleaning plan

WEDNESDAY-THURSDAY (Days 3-4):

  • Complete data cleaning
  • Statistical analysis
  • Build visualizations
  • Document findings

FRIDAY-SATURDAY (Days 5-6):

  • Build ML models
  • Evaluate and compare
  • Tune best model
  • Write report

SUNDAY-MONDAY (Days 7-8):

  • Finalize report
  • Create presentation
  • Practice presentation
  • Submit all deliverables

DELIVERABLES CHECKLIST:

  • CLEANED DATASET

☑ CSV file with processed data ☑ Data dictionary (what each variable means) ☑ Documentation of cleaning decisions

  • R SCRIPTS

☑ 01_load_explore.R - Data loading and EDA ☑ 02_clean.R - Cleaning code ☑ 03_analysis.R - Statistical analysis ☑ 04_models.R - ML models ☑ 05_report.R - Generate report ☑ README.md - How to run everything

  • REPORTS/VISUALIZATIONS

☑ EDA Report (10-15 visualizations) ☑ Statistical Analysis Results ☑ Model Performance Comparisons ☑ Final Insights Document

  • PROFESSIONAL REPORT

☑ Executive Summary (1 page) ☑ Problem Statement ☑ Data Description ☑ Methodology ☑ Results and Findings ☑ Conclusions and Recommendations ☑ Appendix (code, tables)

  • PRESENTATION

☑ 10-15 minute presentation ☑ Slides with key findings ☑ Clear story arc ☑ Professional appearance ☑ Practice beforehand

PROJECT IDEAS:

Dataset Options:

  • Housing Prices (kaggle.com/c/house-prices-advanced-regression-techniques)
  • Titanic Survival (kaggle.com/c/titanic)
  • Iris Classification (built-in, classic)
  • Customer Churn (find on Kaggle)
  • Heart Disease (UCI ML repository)
  • Stock Market Data (get with yfinance)
  • Business Data (find internal sources)

YOUR REPOSITORY STRUCTURE:

capstone_project/
├── README.md (Project overview)
├── data/
│ ├── raw/
│ │ └── dataset.csv (Original data)
│ └── processed/
│ └── clean_data.csv (Cleaned data)
├── notebooks/
│ ├── 01_exploration.Rmd
│ ├── 02_analysis.Rmd
│ └── 03_models.Rmd
├── scripts/
│ ├── functions.R (Custom functions)
│ └── config.R (Settings)
├── results/
│ ├── figures/
│ │ ├── distribution.png
│ │ ├── correlation.png
│ │ └── ...
│ └── tables/
│ └── model_comparison.csv
├── report/
│ ├── final_report.docx
│ ├── presentation.pptx
│ └── data_dictionary.csv
└── .gitignore

BEST PRACTICES:

Code Quality:
✓ Use meaningful variable names
✓ Comment complex logic
✓ Follow consistent style
✓ DRY principle (Don't Repeat Yourself)
✓ Use functions for reusable code
✓ Handle errors gracefully

Reproducibility:
✓ Set seed: set.seed(42)
✓ Relative paths: "data/raw/file.csv"
✓ Document dependencies: library() calls
✓ Specify versions if needed
✓ No hardcoded file paths
✓ Can run entire analysis fresh

Documentation:
✓ README explains purpose
✓ Code comments explain why
✓ Data dictionary explains what
✓ Report explains findings
✓ Presentation tells story

GRADING RUBRIC (100 points):

Data Preparation (15%):
- Cleaning documented
- Handling of missing data justified
- Appropriate transformations
- Final dataset quality

Exploratory Analysis (15%):
- Thorough visualization
- Statistical summaries
- Insights documented
- Pattern identification

Statistical Analysis (15%):
- Appropriate tests chosen
- Assumptions checked
- Results interpreted correctly
- Effect sizes reported

Machine Learning (20%):
- Multiple models compared
- Evaluation metrics used
- Model selection justified
- Interpretable results

Code Quality (15%):
- Clean, readable code
- Well organized
- Reproducible
- Commented appropriately

Report & Presentation (20%):
- Professional writing
- Clear visualizations
- Compelling story
- Actionable recommendations
- Effective delivery

FINAL TIPS:

1. START EARLY - Don't wait until Sunday!
2. EXPLORE THOROUGHLY - You'll find better insights
3. CLEAN CAREFULLY - 70% of time here
4. TRY MULTIPLE MODELS - Compare, don't just use one
5. INTERPRET RESULTS - Numbers mean nothing without context
6. TELL A STORY - Guide reader through your analysis
7. ASK QUESTIONS - What surprises you in the data?
8. VISUALIZE WELL - Graphics communicate better than tables
9. DOCUMENT DECISIONS - Why you chose each approach
10. PRACTICE PRESENTATION - Rehearse beforehand

COMMON MISTAKES TO AVOID:

✗ Using test data during training
✗ Ignoring class imbalance
✗ Over-interpreting results
✗ No cross-validation
✗ Forgetting to scale features
✗ Not checking model assumptions
✗ Perfect accuracy (sign of data leakage)
✗ Too much jargon in report
✗ Weak visualizations
✗ No business interpretation

WHAT "EXCELLENT" LOOKS LIKE:

1. Insightful findings that surprise/inform
2. Multiple valid approaches compared
3. Clear decision trail documented
4. Professional presentation
5. Reproducible code
6. Actionable recommendations
7. Sophisticated analysis
8. Well-written report
9. Compelling presentation
10. Portfolio-ready quality

You're ready! Good luck with your capstone project!