Spaces:
Build error
Build error
bills
commited on
Commit
•
94f8771
1
Parent(s):
fc7298c
Added some changes
Browse files- app.py +7 -3
- requirements.txt +1 -1
app.py
CHANGED
@@ -15,7 +15,7 @@ from tensorflow.keras.models import load_model
|
|
15 |
|
16 |
st.set_page_config(
|
17 |
page_title="FANG Stock Prediction",
|
18 |
-
page_icon=":
|
19 |
layout="wide"
|
20 |
)
|
21 |
|
@@ -68,7 +68,8 @@ def test_data_predict(lstm_model):
|
|
68 |
stock_lstm = load_model("fang_stock_prediction.h5")
|
69 |
|
70 |
predict_prices = test_data_predict(lstm_model=stock_lstm)
|
71 |
-
valid =
|
|
|
72 |
valid['Predictions'] = predict_prices
|
73 |
|
74 |
stock_data = ['Stock Price of Google From 2007 - 2021', 'Actual Stock Price and Model Prediction']
|
@@ -76,8 +77,11 @@ stock_data = ['Stock Price of Google From 2007 - 2021', 'Actual Stock Price and
|
|
76 |
selection = st.selectbox("Select country", stock_data)
|
77 |
if selection == 'Stock Price of Google From 2007 - 2021':
|
78 |
st.line_chart(data_GOOG.filter(['Adj Close']))
|
|
|
79 |
elif selection == 'Actual Stock Price and Model Prediction':
|
80 |
-
|
|
|
|
|
81 |
|
82 |
# fig, ax = plt.subplots()
|
83 |
# plt.figure(figsize=(10, 8))
|
|
|
15 |
|
16 |
st.set_page_config(
|
17 |
page_title="FANG Stock Prediction",
|
18 |
+
page_icon=":currency:",
|
19 |
layout="wide"
|
20 |
)
|
21 |
|
|
|
68 |
stock_lstm = load_model("fang_stock_prediction.h5")
|
69 |
|
70 |
predict_prices = test_data_predict(lstm_model=stock_lstm)
|
71 |
+
valid = pd.DataFrame()
|
72 |
+
valid['Actual Data'] = test_data_GOOG.filter(['Adj Close'])
|
73 |
valid['Predictions'] = predict_prices
|
74 |
|
75 |
stock_data = ['Stock Price of Google From 2007 - 2021', 'Actual Stock Price and Model Prediction']
|
|
|
77 |
selection = st.selectbox("Select country", stock_data)
|
78 |
if selection == 'Stock Price of Google From 2007 - 2021':
|
79 |
st.line_chart(data_GOOG.filter(['Adj Close']))
|
80 |
+
st.dataframe(data_GOOG.filter(['High', 'Low', 'Open', 'Close', 'Adj Close']), use_container_width=True)
|
81 |
elif selection == 'Actual Stock Price and Model Prediction':
|
82 |
+
st.line_chart(data_GOOG.filter(['Adj Close'])).add_rows(valid)
|
83 |
+
st.dataframe(valid, use_container_width=True)
|
84 |
+
st.text(valid.shape)
|
85 |
|
86 |
# fig, ax = plt.subplots()
|
87 |
# plt.figure(figsize=(10, 8))
|
requirements.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
numpy>=1.17.3
|
2 |
pandas==1.3.5
|
3 |
-
streamlit==1.
|
4 |
tensorflow==2.6.0
|
5 |
pandas-datareader==0.10.0
|
6 |
sklearn==0.0
|
|
|
1 |
numpy>=1.17.3
|
2 |
pandas==1.3.5
|
3 |
+
streamlit==1.14.0
|
4 |
tensorflow==2.6.0
|
5 |
pandas-datareader==0.10.0
|
6 |
sklearn==0.0
|