Spaces:
Runtime error
Runtime error
masa729406
commited on
Commit
Β·
23d8057
1
Parent(s):
339e1ff
Update app.py
Browse files
app.py
CHANGED
@@ -14,6 +14,13 @@ import pandas as pd
|
|
14 |
df_pre = pd.read_csv('data')
|
15 |
y = df_pre['audience']
|
16 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
17 |
|
18 |
def outbreak(date):
|
19 |
if date:
|
@@ -21,7 +28,7 @@ def outbreak(date):
|
|
21 |
# final_day = date
|
22 |
# x = np.arange(start_day, final_day + 1)
|
23 |
fig = plt.figure()
|
24 |
-
plt.plot(
|
25 |
plt.title("audience")
|
26 |
plt.ylabel("audience")
|
27 |
plt.xlabel("Days since Day 0")
|
|
|
14 |
df_pre = pd.read_csv('data')
|
15 |
y = df_pre['audience']
|
16 |
|
17 |
+
filename = 'model.pkl'
|
18 |
+
loaded_rf_model = pickle.load(open(filename, 'rb'))
|
19 |
+
X_test = pd.DataFrame(
|
20 |
+
data={'saba': [300, 200, 3030, 400],
|
21 |
+
'date_ymd': [20230328, 20230329, 20230330, 20230331]}
|
22 |
+
)
|
23 |
+
y_pred_ = loaded_rf_model.predict(X_test, num_iteration=gbm.best_iteration)
|
24 |
|
25 |
def outbreak(date):
|
26 |
if date:
|
|
|
28 |
# final_day = date
|
29 |
# x = np.arange(start_day, final_day + 1)
|
30 |
fig = plt.figure()
|
31 |
+
plt.plot(y_pred_)
|
32 |
plt.title("audience")
|
33 |
plt.ylabel("audience")
|
34 |
plt.xlabel("Days since Day 0")
|