Instructions to use AhaseesAI/traffic-prediction with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use AhaseesAI/traffic-prediction with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("AhaseesAI/traffic-prediction", "sklearn_model.joblib") ) # only load pickle files from sources you trust # read more about it here https://skops.readthedocs.io/en/stable/persistence.html - Notebooks
- Google Colab
- Kaggle
Create README.md
Browse files
README.md
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
metrics:
|
| 6 |
+
- accuracy
|
| 7 |
+
library_name: sklearn
|
| 8 |
+
tags:
|
| 9 |
+
- Traffic
|
| 10 |
+
- ML
|
| 11 |
+
- Random-forest
|
| 12 |
+
- Classification
|
| 13 |
+
- Scikit-learn
|
| 14 |
+
---
|
| 15 |
+
# Traffic Prediction Model
|
| 16 |
+
|
| 17 |
+
## Model Description
|
| 18 |
+
This model is a **Random Forest Classifier** trained to predict **traffic conditions** based on various input features.
|
| 19 |
+
It helps estimate traffic congestion levels using structured data such as **time of day, weather, and historical patterns**.
|
| 20 |
+
|
| 21 |
+
## Training Details
|
| 22 |
+
- **Algorithm**: Random Forest Classifier
|
| 23 |
+
- **Dataset**: Custom traffic dataset
|
| 24 |
+
- **Preprocessing**: Label encoding for categorical variables
|
| 25 |
+
- **Framework**: scikit-learn
|
| 26 |
+
|
| 27 |
+
## How to Use
|
| 28 |
+
To use this model, install the required libraries and download the model from Hugging Face.
|
| 29 |
+
|
| 30 |
+
To load and use the model:
|
| 31 |
+
```python
|
| 32 |
+
import joblib
|
| 33 |
+
from huggingface_hub import hf_hub_download
|
| 34 |
+
|
| 35 |
+
# Download model
|
| 36 |
+
model_path = hf_hub_download(repo_id="AhaseesAI/traffic-prediction", filename="traffic_classifier.pkl")
|
| 37 |
+
encoder_path = hf_hub_download(repo_id="AhaseesAI/traffic-prediction", filename="target_encoder.pkl")
|
| 38 |
+
|
| 39 |
+
# Load model
|
| 40 |
+
model = joblib.load(model_path)
|
| 41 |
+
target_encoder = joblib.load(encoder_path)
|
| 42 |
+
|
| 43 |
+
# Example prediction
|
| 44 |
+
sample_data = [[value1, value2, value3, ...]] # Replace with actual feature values
|
| 45 |
+
prediction = model.predict(sample_data)
|
| 46 |
+
|
| 47 |
+
# Convert prediction to original label
|
| 48 |
+
predicted_label = target_encoder.inverse_transform(prediction)
|
| 49 |
+
print(f"Predicted Traffic Status: {predicted_label[0]}")
|