Downloads · 30 days
0
Waleed74/traffic-prediction-pk
traffic-prediction-pk is a tabular classification model from Waleed74. Use it for the tabular classification task on the model card, and read the license before you ship it in a product. It is set up for sklearn. The card lists the license as mit.
To load and use this traffic prediction model in Python:
Downloads · 30 days
0
Access
Public
Updated Jan 2, 2026
Repo size
69.5 MB
Likes
0
Public
Click a slice to open those files.
.pkl69.5 MB · 100%
From the Hugging Face model README
To load and use this traffic prediction model in Python:
import joblib
from huggingface_hub import hf_hub_download
import pandas as pd
repo_id = "Waleed74/traffic-prediction-pk"
# Download model & encoder
model_path = hf_hub_download(repo_id=repo_id, filename="traffic_classifier.pkl")
encoder_path = hf_hub_download(repo_id=repo_id, filename="target_encoder.pkl")
# Load them
model = joblib.load(model_path)
target_encoder = joblib.load(encoder_path)
feature_names = model.feature_names_in_
print("Feature names:", feature_names)
# Example input row
row = [
18, # Time
2, # Day of the week
320, # CarCount
150, # BikeCount
20, # BusCount
10, # TruckCount
500, # Total
0 # Traffic Situation
]
df = pd.DataFrame([row], columns=feature_names)
prediction = model.predict(df)
predicted_label = target_encoder.inverse_transform(prediction)[0]
print("Predicted Traffic Status:", predicted_label)