Spaces:
Sleeping
Sleeping
Анастасия
commited on
Commit
•
ba32694
1
Parent(s):
246a07c
- app.py +1 -1
- pages/3_🪙_Прогноз_Bitcoin USD. BiLSTM.py +20 -28
app.py
CHANGED
@@ -84,7 +84,7 @@ with col1:
|
|
84 |
fig.add_trace(go.Scatter(x=data['Date'], y=data['Close'], name="Цена закрытия"))
|
85 |
fig.update_layout(title_text=text, xaxis_rangeslider_visible=True)
|
86 |
fig.update_traces(showlegend=True)
|
87 |
-
st.plotly_chart(fig)
|
88 |
|
89 |
data = load_data('^DJI')
|
90 |
last_DJI = data['Close'].iloc[-1]
|
|
|
84 |
fig.add_trace(go.Scatter(x=data['Date'], y=data['Close'], name="Цена закрытия"))
|
85 |
fig.update_layout(title_text=text, xaxis_rangeslider_visible=True)
|
86 |
fig.update_traces(showlegend=True)
|
87 |
+
st.plotly_chart(fig, use_container_width=True)
|
88 |
|
89 |
data = load_data('^DJI')
|
90 |
last_DJI = data['Close'].iloc[-1]
|
pages/3_🪙_Прогноз_Bitcoin USD. BiLSTM.py
CHANGED
@@ -106,34 +106,29 @@ adjusted_future_pred = pd.Series([x.item() for x in adjusted_future_predictions]
|
|
106 |
# Форматирование каждой даты в нужный формат
|
107 |
formatted_dates = np.datetime_as_string(future_dates)
|
108 |
|
109 |
-
fig = go.Figure()
|
110 |
-
fig.add_trace(go.Scatter(x=df['Date'],
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
fig.add_trace(go.Scatter(x=formatted_dates,
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
fig.update_layout(title=f'График прогноза для {period} дней по Bitcoin, USD 🇺🇸',
|
123 |
-
|
124 |
-
|
125 |
-
xaxis=dict(tickangle=45),
|
126 |
-
# xaxis_range=[datetime(2023, 12, 25), datetime(2024, 2, 13)],
|
127 |
-
showlegend=True)
|
128 |
-
|
129 |
-
st.plotly_chart(fig, use_container_width=True)
|
130 |
|
131 |
fig = go.Figure()
|
132 |
fig.add_trace(go.Scatter(x=df['Date'],
|
133 |
y=df['Adj Close'],
|
134 |
mode='lines',
|
135 |
name='Актуальные данные',
|
136 |
-
line=dict(
|
137 |
|
138 |
fig.add_trace(go.Scatter(x=formatted_dates,
|
139 |
y=adjusted_future_pred,
|
@@ -141,14 +136,11 @@ fig.add_trace(go.Scatter(x=formatted_dates,
|
|
141 |
name='Прогноз будущее',
|
142 |
line=dict(color='red', width=2, dash='dash')))
|
143 |
|
144 |
-
fig.update_layout(title=f'График прогноза для {period} дней по Bitcoin, USD
|
145 |
-
xaxis_title='Дата',
|
146 |
-
yaxis_title='Цена закрытия',
|
147 |
xaxis=dict(tickangle=45),
|
148 |
-
# xaxis_range=[datetime(2023, 12, 25), datetime(2024, 2, 13)],
|
149 |
xaxis_range=[datetime.strptime(latest_date, '%Y-%m-%d') - timedelta(days=12), \
|
150 |
-
datetime.strptime(latest_date, '%Y-%m-%d') + timedelta(days=18)],
|
151 |
-
|
152 |
|
153 |
st.plotly_chart(fig, use_container_width=True)
|
154 |
|
|
|
106 |
# Форматирование каждой даты в нужный формат
|
107 |
formatted_dates = np.datetime_as_string(future_dates)
|
108 |
|
109 |
+
# fig = go.Figure()
|
110 |
+
# fig.add_trace(go.Scatter(x=df['Date'],
|
111 |
+
# y=df['Adj Close'],
|
112 |
+
# mode='lines',
|
113 |
+
# name='Актуальные данные',
|
114 |
+
# line=dict(width=2)))
|
115 |
+
|
116 |
+
# fig.add_trace(go.Scatter(x=formatted_dates,
|
117 |
+
# y=adjusted_future_pred,
|
118 |
+
# mode='lines+markers',
|
119 |
+
# name='Прогноз будущее',
|
120 |
+
# line=dict(color='red', width=2, dash='dash')))
|
121 |
+
|
122 |
+
# fig.update_layout(title=f'График прогноза для {period} дней по Bitcoin, USD 🇺🇸',
|
123 |
+
# xaxis=dict(tickangle=45), xaxis_rangeslider_visible=True, showlegend=True)
|
124 |
+
# st.plotly_chart(fig, use_container_width=True)
|
|
|
|
|
|
|
|
|
|
|
125 |
|
126 |
fig = go.Figure()
|
127 |
fig.add_trace(go.Scatter(x=df['Date'],
|
128 |
y=df['Adj Close'],
|
129 |
mode='lines',
|
130 |
name='Актуальные данные',
|
131 |
+
line=dict(width=2)))
|
132 |
|
133 |
fig.add_trace(go.Scatter(x=formatted_dates,
|
134 |
y=adjusted_future_pred,
|
|
|
136 |
name='Прогноз будущее',
|
137 |
line=dict(color='red', width=2, dash='dash')))
|
138 |
|
139 |
+
fig.update_layout(title=f'График прогноза для {period} дней по Bitcoin, USD 🇺🇸',
|
|
|
|
|
140 |
xaxis=dict(tickangle=45),
|
|
|
141 |
xaxis_range=[datetime.strptime(latest_date, '%Y-%m-%d') - timedelta(days=12), \
|
142 |
+
datetime.strptime(latest_date, '%Y-%m-%d') + timedelta(days=18)],
|
143 |
+
xaxis_rangeslider_visible=True, showlegend=True)
|
144 |
|
145 |
st.plotly_chart(fig, use_container_width=True)
|
146 |
|