-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStarter.py
More file actions
18 lines (15 loc) · 913 Bytes
/
Starter.py
File metadata and controls
18 lines (15 loc) · 913 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import csv
from AccidentPredictor import AccidentPredictor
from RideScenario import RideScenario
from Utilities import parseToFloat
predictor = AccidentPredictor()
with open("test_data.csv", "rb") as testObj:
reader = csv.DictReader(testObj)
for row in reader:
currentRideScenario = RideScenario(parseToFloat(row["Longitude"]), parseToFloat(row["Latitude"]),
parseToFloat(row["Day_of_Week"]), parseToFloat(row["Time"].replace(':', '')),
parseToFloat(row["Road_Type"]), parseToFloat(row["Speed_limit"]),
parseToFloat(row["Light_Conditions"]),
parseToFloat(row["Weather_Conditions"]),
parseToFloat(row["Road_Surface_Conditions"]))
predictor.predictFor(currentRideScenario)