Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -315,6 +315,25 @@ def main():
|
|
| 315 |
row=1, col=1, secondary_y=True
|
| 316 |
)
|
| 317 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 318 |
# จำนวนข่าว
|
| 319 |
for col in ["neutral", "negative", "positive"]:
|
| 320 |
if col not in plot_data.columns:
|
|
|
|
| 315 |
row=1, col=1, secondary_y=True
|
| 316 |
)
|
| 317 |
|
| 318 |
+
# ---------------------------------------------------------
|
| 319 |
+
# เส้นเชื่อม Actual -> Predicted
|
| 320 |
+
# ---------------------------------------------------------
|
| 321 |
+
last_actual_date = plot_data["date_day"].max()
|
| 322 |
+
last_actual_value = plot_data["avg_sentiment"].iloc[-1]
|
| 323 |
+
first_pred_date = future_dates[0]
|
| 324 |
+
first_pred_value = future_preds[0]
|
| 325 |
+
|
| 326 |
+
fig.add_trace(
|
| 327 |
+
go.Scatter(
|
| 328 |
+
x=[last_actual_date, first_pred_date],
|
| 329 |
+
y=[last_actual_value, first_pred_value],
|
| 330 |
+
mode="lines",
|
| 331 |
+
line=dict(color="#05a0fa", dash="dot"),
|
| 332 |
+
name="Connector Actual→Predicted"
|
| 333 |
+
),
|
| 334 |
+
row=1, col=1, secondary_y=True
|
| 335 |
+
)
|
| 336 |
+
|
| 337 |
# จำนวนข่าว
|
| 338 |
for col in ["neutral", "negative", "positive"]:
|
| 339 |
if col not in plot_data.columns:
|