Instructions to use Yukin3/TPnet-baseline with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Scikit-learn
How to use Yukin3/TPnet-baseline with Scikit-learn:
from huggingface_hub import hf_hub_download import joblib model = joblib.load( hf_hub_download("Yukin3/TPnet-baseline", "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
TPnet-baseline
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.
Model Details
- Model type: Random Forest Classifier
- Input features: 20 numerical features including vehicle count, road occupancy, weather, traffic light status, time-of-day, and more
- Output: Multiclass classification –
High,Medium,Lowtraffic congestion - License: MIT
- Trained on: Smart Mobility Traffic Dataset from Kaggle
Training Details
- Train/test split: 80/20
- Accuracy (test): 99.9%
- F1 Score: 0.999
- Class-balanced via stratified sampling
- No overfitting observed
Evaluation
| Metric | Value |
|---|---|
| Accuracy | 99.9% |
| F1 Score | 0.999 |
| Model Size | ~1.2MB |
Confusion matrix and full report are available in the repository.
How to Use
import pickle
with open("traffic_predictor_rf.pkl", "rb") as f:
model = pickle.load(f)
y_pred = model.predict(X_test) # where X_test is a [n_samples, 20] array
Limitations
Does not account for live data
Designed for offline batch inference
Assumes all 20 features are properly preprocessed and scaled
Authors
- Created by @Yukin3
- Downloads last month
- -