Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,57 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
---
|
| 4 |
+
# TPnet-baseline
|
| 5 |
+
|
| 6 |
+
TPnet-baseline is a Random Forest classifier trained on smart mobility and traffic features to predict traffic congestion levels (Low, Medium, High) in urban environments.
|
| 7 |
+
|
| 8 |
+
## Model Details
|
| 9 |
+
|
| 10 |
+
- **Model type**: Random Forest Classifier
|
| 11 |
+
- **Input features**: 20 numerical features including vehicle count, road occupancy, weather, traffic light status, time-of-day, and more
|
| 12 |
+
- **Output**: Multiclass classification – `High`, `Medium`, `Low` traffic congestion
|
| 13 |
+
- **License**: MIT
|
| 14 |
+
- **Trained on**: Smart Mobility Traffic Dataset from Kaggle
|
| 15 |
+
|
| 16 |
+
## Training Details
|
| 17 |
+
|
| 18 |
+
- Train/test split: 80/20
|
| 19 |
+
- Accuracy (test): 99.9%
|
| 20 |
+
- F1 Score: 0.999
|
| 21 |
+
- Class-balanced via stratified sampling
|
| 22 |
+
- No overfitting observed
|
| 23 |
+
|
| 24 |
+
## Evaluation
|
| 25 |
+
|
| 26 |
+
| Metric | Value |
|
| 27 |
+
|------------|--------|
|
| 28 |
+
| Accuracy | 99.9% |
|
| 29 |
+
| F1 Score | 0.999 |
|
| 30 |
+
| Model Size | ~1.2MB |
|
| 31 |
+
|
| 32 |
+
Confusion matrix and full report are available in the repository.
|
| 33 |
+
|
| 34 |
+
## How to Use
|
| 35 |
+
|
| 36 |
+
```python
|
| 37 |
+
import pickle
|
| 38 |
+
|
| 39 |
+
with open("traffic_predictor_rf.pkl", "rb") as f:
|
| 40 |
+
model = pickle.load(f)
|
| 41 |
+
|
| 42 |
+
y_pred = model.predict(X_test) # where X_test is a [n_samples, 20] array
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
## Limitations
|
| 46 |
+
|
| 47 |
+
- Does not account for live data
|
| 48 |
+
|
| 49 |
+
- Designed for offline batch inference
|
| 50 |
+
|
| 51 |
+
- Assumes all 20 features are properly preprocessed and scaled
|
| 52 |
+
|
| 53 |
+
|
| 54 |
+
## Authors
|
| 55 |
+
|
| 56 |
+
- Created by [@Yukin3](https://github.com/Yukin3)
|
| 57 |
+
|