# Distracted Driving Risk Detection Challenge — Data

来源：https://www.kaggle.com/competitions/distracted-driving-risk-detection-challenge/data

采集时间：2026-10-19T17:55:54Z

This competition uses real-world driving data collected from urban driving sessions. The dataset contains time series observations from vehicle sensors, driver health monitors, weather conditions, and historical traffic data.

### What am I predicting?

You are predicting the **risk_level** of traffic accidents for each observation in the test set. The risk level is a categorical variable with 4 classes:

- **1** = Low risk (normal, safe driving conditions)
- **2** = Medium risk (elevated risk requiring attention)
- **3** = High risk (dangerous conditions requiring intervention)
- **4** = Very high risk (critical situations with imminent danger)

### What files do I need?

**Required for modeling:**
- **`kaggle_train.csv`** - Training data with risk_level labels
- **`kaggle_test.csv`** - Test data (predict risk_level for these rows)
- **`kaggle_sample_submission.csv`** - Example submission format

**Optional for advanced techniques:**
- **`kaggle_full_unlabeled_data.csv`** - Additional unlabeled data for semi-supervised learning

### What should I expect the data format to be?

All files are in CSV (comma-separated values) format with headers. Each row represents a single time-stamped observation from a driving session.

---

## Files

### kaggle_train.csv
The training set containing **1,980 labeled observations**.

- **Balanced classes**: 495 observations per risk level (1, 2, 3, 4)
- **14 features** + 1 target variable (`risk_level`)
- Use this data to train your models

### kaggle_test.csv
The test set containing **23,152 observations**.

- Same 14 features as training data
- **No `risk_level` column** (this is what you're predicting)
- No `id` column - use row index (0 to 23,151) as the id in your submission

### kaggle_sample_submission.csv
A sample submission file in the correct format.

- **2 columns**: `id`, `risk_level`
- **23,153 rows**: Header + 23,152 predictions
- Shows the exact format your submission must match

### kaggle_full_unlabeled_data.csv
Additional unlabeled data containing **82,223 observations**.

- **Optional** - Not required for basic approaches
- Contains raw data with additional features beyond the competition dataset
- No `risk_level` labels provided
- Useful for:
  - Semi-supervised learning
  - Unsupervised pre-training
  - Understanding feature distributions
  - Data augmentation techniques

---

## Columns

### Target Variable

- **`risk_level`** - Traffic accident risk classification (1=Low, 2=Medium, 3=High, 4=Very High). **This is what you're predicting.** Only present in training data.

### Vehicle Telemetry Features
*Source: OBD-II (On-Board Diagnostics) scanner connected to vehicle*

- **`speed`** - Current vehicle speed in kilometers per hour (km/h). Range: 0-150+
- **`rpm`** - Engine revolutions per minute. Indicates how fast the engine is spinning. Range: 0-7000+
- **`acceleration`** - Vehicle acceleration in meters per second squared (m/s²). Positive values = accelerating, negative values = decelerating (braking). Range: -10 to +10
- **`throttle_position`** - Throttle pedal position as a percentage (0-100%). Higher values indicate more aggressive acceleration.
- **`engine_temperature`** - Engine coolant temperature in degrees Celsius (°C). Normal range: 80-120°C
- **`engine_load_value`** - Current engine load as a percentage (0-100%). Indicates how hard the engine is working.

### Driver Health Features
*Source: Wearable health monitoring device*

- **`heart_rate`** - Driver's heart rate in beats per minute (bpm). Can indicate driver stress, fatigue, or alertness. Range: 40-200

### Temporal Features

- **`observation_hour`** - Hour of the day when observation was recorded, in 24-hour format (0-23). Useful for identifying rush hour, night driving, etc.

### Weather & Environmental Features
*Source: Weather API based on GPS location*

- **`current_weather`** - Encoded weather condition. Higher numeric values generally indicate worse weather conditions.
- **`visibility`** - Visibility distance in kilometers (km). Lower values indicate fog, rain, or other visibility-reducing conditions. Range: 0-20+
- **`precipitation`** - Precipitation amount in millimeters (mm). Includes rain, snow, sleet. Range: 0-50+

### Traffic & Road Infrastructure Features
*Source: Historical traffic accident database and road characteristics*

- **`accidents_onsite`** - Number of historical fatal accidents (deaths) that have occurred at this specific location. Higher values indicate historically dangerous locations. Range: 0-30+
- **`design_speed`** - The posted or design speed limit for this road segment in km/h. Used to assess speeding behavior. Range: 30-90
- **`accidents_time`** - Number of historical fatal accidents (deaths) that have occurred during similar time periods at various locations. Captures temporal risk patterns. Range: 0-10+

### Submission File Columns

- **`id`** - Integer identifier (0 to 23,151) matching the row index in `kaggle_test.csv`
- **`risk_level`** - Your predicted risk level (must be 1, 2, 3, or 4)

---

## Important Notes

### Time Series Nature
This is **time series data** from sequential driving sessions. While you can treat each row independently, temporal patterns may be informative:
- Consecutive rows may come from the same driving session
- Consider rolling statistics, rate of change, and sequence patterns
- LSTM, GRU, or attention-based models may capture temporal dependencies

### Data Collection Context
Data was collected from:
- 5 real drivers + 1 synthetic driver
- 3 vehicle types (CUV, Pickup, Sedan)
- 2 urban routes through high-traffic accident zones
- Location: Quito, Ecuador
- Total: ~18 hours of driving data

### Missing Values
Check for missing values in your specific dataset. Handle them appropriately for your chosen model.

### Scale Differences
Features have vastly different scales (e.g., rpm goes to 7000+, visibility might be 0-20). Consider:
- Normalization/standardization
- Feature scaling appropriate for your model choice

### Feature Engineering Ideas

Consider creating derived features:
- **Speed violations**: `speed / design_speed` (>1.0 indicates speeding)
- **Aggressive driving**: High acceleration + high throttle
- **Driver stress**: Elevated heart rate relative to baseline
- **Environmental risk**: Combined weather + visibility + precipitation score
- **Location risk**: `accidents_onsite + accidents_time`
- **Time-based risk**: Rush hour indicators, night driving flags

### Class Imbalance
- **Training set**: Perfectly balanced (495 per class)
- **Test set**: Distribution unknown (may not be balanced)

Consider this when:
- Choosing evaluation metrics for cross-validation
- Deciding whether to use class weights
- Interpreting model confidence scores

---

## Acronyms & Terms

- **OBD-II** - On-Board Diagnostics (version 2), the vehicle's diagnostic system
- **bpm** - Beats per minute (heart rate)
- **rpm** - Revolutions per minute (engine speed)
- **km/h** - Kilometers per hour (speed)
- **m/s²** - Meters per second squared (acceleration)
- **mm** - Millimeters (precipitation)
- **°C** - Degrees Celsius (temperature)
- **CUV** - Crossover Utility Vehicle (vehicle type)
- **GPS** - Global Positioning System

---

## Getting Started

1. **Load the data**: Read `kaggle_train.csv` and `kaggle_test.csv`
2. **Explore**: Check distributions, correlations, missing values
3. **Engineer features**: Create domain-specific features (speed ratios, driver stress indicators, etc.)
4. **Train models**: Start with a simple baseline (e.g., Random Forest, XGBoost)
5. **Validate**: Use cross-validation to assess performance
6. **Make predictions**: Generate predictions for `kaggle_test.csv`
7. **Submit**: Format as shown in `kaggle_sample_submission.csv`

Good luck! 🚗📊
