Spaces:
Runtime error
Runtime error
Ziyou Li
commited on
Commit
•
c6c72d9
1
Parent(s):
d48d55d
Update app.py
Browse files
app.py
CHANGED
@@ -62,14 +62,14 @@ def infer(input_dataframe):
|
|
62 |
serie = input_dataframe["referenceTime"]
|
63 |
ts = dp.parse(serie.iloc[0]).timestamp()
|
64 |
input_dataframe["referenceTime"] = ts
|
65 |
-
res = pd.DataFrame(model.predict(input_dataframe)).clip(0, 1)
|
66 |
if res > 0.8:
|
67 |
status = "Smooth Traffic on E4"
|
68 |
elif res > 0.5:
|
69 |
status = "Slight congestion on E4"
|
70 |
else:
|
71 |
status = "Total congestion on E4"
|
72 |
-
return pd.Dataframe[res, status]
|
73 |
|
74 |
title = "Stoclholm Highway E4 Real Time Traffic Prediction"
|
75 |
description = "Stockholm E4 (59°23'44.7"" N 17°59'00.4""E) highway real time traffic prediction"
|
|
|
62 |
serie = input_dataframe["referenceTime"]
|
63 |
ts = dp.parse(serie.iloc[0]).timestamp()
|
64 |
input_dataframe["referenceTime"] = ts
|
65 |
+
res = pd.DataFrame(model.predict(input_dataframe)).clip(0, 1).iloc[0, 0]
|
66 |
if res > 0.8:
|
67 |
status = "Smooth Traffic on E4"
|
68 |
elif res > 0.5:
|
69 |
status = "Slight congestion on E4"
|
70 |
else:
|
71 |
status = "Total congestion on E4"
|
72 |
+
return pd.Dataframe({'Freeflow Level':[res], 'Status': [status]})
|
73 |
|
74 |
title = "Stoclholm Highway E4 Real Time Traffic Prediction"
|
75 |
description = "Stockholm E4 (59°23'44.7"" N 17°59'00.4""E) highway real time traffic prediction"
|