## YouTube Trends ML Pipeline
An Apache Airflow DAG that pulls YouTube video data from S3, enriches it with Google Trends scores, trains ML models to predict comment engagement, and uploads all artifacts back to S3.

## What it does
    Extract - downloads `youtube.csv` from an S3 bucket
    Transform - cleans the data, engineers features, balances the dataset by comment bins, and     fetches Google Trends scores for top keywords via `pytrends`
    Train - fits a Linear Regression and a Random Forest model to predict `log(comment_count)`
    Upload - saves models, dataset, trend map, and metrics back to S3 under a timestamped run folder

## Results
| Model             | RMSE  | R²    |
| Linear Regression | 1.839 | 0.232 |
| Random Forest     | 1.290 | 0.622 |

The Random Forest significantly outperforms the baseline. Top predictors are `tags_length`, `publish_country_FRANCE`, `publish_hour`, `tags_count`, and `category_id`.

## Dataset
    50,000 rows, 11 features, trained on data from the last month
    Target: `log_comments` (log-transformed comment count)
    399 keywords enriched with Google Trends interest scores

## Requirements
    Apache Airflow with the Amazon provider (`apache-airflow-providers-amazon`)
    `scikit-learn`, `pandas`, `numpy`, `joblib`
    `pytrends`
    AWS connection configured as `aws_default`
