Maps / Training Congestion Prediction Model
BoojithDharshan's picture
Create Training Congestion Prediction Model
6852f01 verified
raw
history blame contribute delete
317 Bytes
# train_congestion_model.py
import pandas as pd
from sklearn.ensemble import RandomForestClassifier
import joblib
df = pd.read_csv("location_logs.csv")
X = df[['hour', 'day_of_week', 'location_id']]
y = df['is_congested']
model = RandomForestClassifier()
model.fit(X, y)
joblib.dump(model, 'congestion_model.pkl')