Spaces:
Runtime error
Runtime error
YuhangDeng123
commited on
Commit
•
8bdaf8b
1
Parent(s):
7657c22
Update app.py
Browse files
app.py
CHANGED
@@ -39,17 +39,6 @@ city = "Guangzhou"
|
|
39 |
df_weather = get_weather_data_weekly(city, today)
|
40 |
df_weather.date = df_weather.date.apply(timestamp_2_time)
|
41 |
df_weather_x = df_weather.drop(columns=["date"]).fillna(0)
|
42 |
-
df_weather_nn=np.array(df_weather_x)
|
43 |
-
scaler = StandardScaler()
|
44 |
-
scaler.fit(df_weather_x)
|
45 |
-
|
46 |
-
df_weather_use=scaler.transform(df_weather_x)
|
47 |
-
|
48 |
-
df_weather_use_1= pd.DataFrame(df_weather_use)
|
49 |
-
|
50 |
-
#preds_zzz = model.predict(df_weather_use_1).astype(int)
|
51 |
-
|
52 |
-
st.write(36 * "-")
|
53 |
|
54 |
########################根据模型名称进行修改#####################
|
55 |
mr = project.get_model_registry()
|
@@ -60,7 +49,7 @@ model = joblib.load(model_dir + "/AIR_Forecast_Model.pkl")
|
|
60 |
st.write("-" * 36)
|
61 |
|
62 |
|
63 |
-
preds = model.predict(
|
64 |
pollution_level = get_aplevel(preds.T.reshape(-1, 1))
|
65 |
|
66 |
next_week = [f"{(today + timedelta(days=d)).strftime('%Y-%m-%d')},{(today + timedelta(days=d)).strftime('%A')}" for d in range(8)]
|
|
|
39 |
df_weather = get_weather_data_weekly(city, today)
|
40 |
df_weather.date = df_weather.date.apply(timestamp_2_time)
|
41 |
df_weather_x = df_weather.drop(columns=["date"]).fillna(0)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42 |
|
43 |
########################根据模型名称进行修改#####################
|
44 |
mr = project.get_model_registry()
|
|
|
49 |
st.write("-" * 36)
|
50 |
|
51 |
|
52 |
+
preds = model.predict(df_weather_x).astype(int)
|
53 |
pollution_level = get_aplevel(preds.T.reshape(-1, 1))
|
54 |
|
55 |
next_week = [f"{(today + timedelta(days=d)).strftime('%Y-%m-%d')},{(today + timedelta(days=d)).strftime('%A')}" for d in range(8)]
|