File size: 1,478 Bytes
de7c47f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
---
license: mit
language:
- en
metrics:
- accuracy
library_name: sklearn
tags:
- Traffic
- ML
- Random-forest
- Classification
- Scikit-learn
---
# Traffic Prediction Model  

## Model Description  
This model is a **Random Forest Classifier** trained to predict **traffic conditions** based on various input features.  
It helps estimate traffic congestion levels using structured data such as **time of day, weather, and historical patterns**.  

## Training Details  
- **Algorithm**: Random Forest Classifier  
- **Dataset**: Custom traffic dataset  
- **Preprocessing**: Label encoding for categorical variables  
- **Framework**: scikit-learn  

## How to Use  
To use this model, install the required libraries and download the model from Hugging Face.  

To load and use the model:
```python
import joblib
from huggingface_hub import hf_hub_download

# Download model
model_path = hf_hub_download(repo_id="AhaseesAI/traffic-prediction", filename="traffic_classifier.pkl")
encoder_path = hf_hub_download(repo_id="AhaseesAI/traffic-prediction", filename="target_encoder.pkl")

# Load model
model = joblib.load(model_path)
target_encoder = joblib.load(encoder_path)

# Example prediction
sample_data = [[value1, value2, value3, ...]]  # Replace with actual feature values
prediction = model.predict(sample_data)

# Convert prediction to original label
predicted_label = target_encoder.inverse_transform(prediction)
print(f"Predicted Traffic Status: {predicted_label[0]}")