Update app.py
Browse files
app.py
CHANGED
@@ -24,6 +24,8 @@ with st.sidebar:
|
|
24 |
start_date = st.date_input('Start Date', dt.date(2020, 1, 1))
|
25 |
end_date = st.date_input('End Date', dt.date.today())
|
26 |
num_of_epochs = st.number_input('Insert a number', step=1, min_value=2, max_value=100, value=10)
|
|
|
|
|
27 |
st.markdown(
|
28 |
f"""
|
29 |
For webpage, please click [here](https://huggingface.co/spaces/eagle0504/stock-forecast).
|
@@ -160,4 +162,9 @@ if st.button('Train Models'):
|
|
160 |
st.success("See the next point forecasts below:")
|
161 |
st.write(f"Mean is: {np.mean(next_point_forecasts)}")
|
162 |
st.write(f"Median is: {np.median(next_point_forecasts)}")
|
163 |
-
st.write(f"Std is: {np.std(next_point_forecasts)}")
|
|
|
|
|
|
|
|
|
|
|
|
24 |
start_date = st.date_input('Start Date', dt.date(2020, 1, 1))
|
25 |
end_date = st.date_input('End Date', dt.date.today())
|
26 |
num_of_epochs = st.number_input('Insert a number', step=1, min_value=2, max_value=100, value=10)
|
27 |
+
n_futures = st.number_input('Length of future (to forecast)', step=1, min_value=10, max_value=300, value=30)
|
28 |
+
n_samples = st.number_input('Number of Simulations (to synthesize)', step=10, min_value=10, max_value=10000, value=50)
|
29 |
st.markdown(
|
30 |
f"""
|
31 |
For webpage, please click [here](https://huggingface.co/spaces/eagle0504/stock-forecast).
|
|
|
162 |
st.success("See the next point forecasts below:")
|
163 |
st.write(f"Mean is: {np.mean(next_point_forecasts)}")
|
164 |
st.write(f"Median is: {np.median(next_point_forecasts)}")
|
165 |
+
st.write(f"Std is: {np.std(next_point_forecasts)}")
|
166 |
+
|
167 |
+
# Create MC Simulation
|
168 |
+
mean_return = np.mean(next_point_forecasts)
|
169 |
+
std_dev = np.std(next_point_forecasts)
|
170 |
+
plot_monte_carlo_forecasts(data=data, n_futures=n_futures, n_samples=n_samples, mean_return, std_dev)
|