Spaces:
Build error
Build error
push
Browse files- app.py +11 -5
- src/__pycache__/get_data.cpython-310.pyc +0 -0
- src/get_data.py +1 -1
app.py
CHANGED
|
@@ -1,20 +1,26 @@
|
|
| 1 |
import seaborn as sns
|
| 2 |
import streamlit as st
|
|
|
|
| 3 |
from src import stock_data, model_train, train_test_split, model_predict
|
|
|
|
| 4 |
st.image('images.jpg', caption='Image credit : Kelly Sikkema')
|
| 5 |
# Function to display result, history, and data information
|
| 6 |
def display_results(user_input,result, data_inf, train):
|
| 7 |
-
st.header(f'Here is the data for {user_input} the past 10 days.')
|
| 8 |
st.write(data_inf)
|
|
|
|
|
|
|
|
|
|
|
|
|
| 9 |
st.markdown(f'''
|
| 10 |
-
Stock Prediction Analysis for <span style="font-size:24px;">{user_input.upper()}</span>
|
| 11 |
|
| 12 |
<p style="font-size:24px;">
|
| 13 |
-
|
| 14 |
</p>
|
| 15 |
''', unsafe_allow_html=True)
|
| 16 |
-
|
| 17 |
-
|
| 18 |
|
| 19 |
|
| 20 |
# Main function to run the app
|
|
|
|
| 1 |
import seaborn as sns
|
| 2 |
import streamlit as st
|
| 3 |
+
from datetime import datetime, timedelta
|
| 4 |
from src import stock_data, model_train, train_test_split, model_predict
|
| 5 |
+
|
| 6 |
st.image('images.jpg', caption='Image credit : Kelly Sikkema')
|
| 7 |
# Function to display result, history, and data information
|
| 8 |
def display_results(user_input,result, data_inf, train):
|
| 9 |
+
st.header(f'Here is the data for {user_input.upper()} the past 10 days.')
|
| 10 |
st.write(data_inf)
|
| 11 |
+
plot = sns.lineplot(train)
|
| 12 |
+
st.pyplot(plot.get_figure())
|
| 13 |
+
future_date = datetime.now() + timedelta(days=1)
|
| 14 |
+
formatted_date = future_date.strftime('%Y-%m-%d')
|
| 15 |
st.markdown(f'''
|
| 16 |
+
## Stock Prediction Analysis for <span style="font-size:24px;">{user_input.upper()}</span>
|
| 17 |
|
| 18 |
<p style="font-size:24px;">
|
| 19 |
+
{formatted_date} {user_input.upper()} predicted price is : <b>{round(result,2)}</b>
|
| 20 |
</p>
|
| 21 |
''', unsafe_allow_html=True)
|
| 22 |
+
|
| 23 |
+
|
| 24 |
|
| 25 |
|
| 26 |
# Main function to run the app
|
src/__pycache__/get_data.cpython-310.pyc
CHANGED
|
Binary files a/src/__pycache__/get_data.cpython-310.pyc and b/src/__pycache__/get_data.cpython-310.pyc differ
|
|
|
src/get_data.py
CHANGED
|
@@ -1,8 +1,8 @@
|
|
| 1 |
import yfinance as yf
|
| 2 |
from datetime import datetime, timedelta
|
| 3 |
-
from sklearn.preprocessing import MinMaxScaler
|
| 4 |
import numpy as np
|
| 5 |
|
|
|
|
| 6 |
def stock_data (tick):
|
| 7 |
data = yf.download(tick, start=datetime.now() - timedelta(days=365),end=datetime.now())
|
| 8 |
return data.Close
|
|
|
|
| 1 |
import yfinance as yf
|
| 2 |
from datetime import datetime, timedelta
|
|
|
|
| 3 |
import numpy as np
|
| 4 |
|
| 5 |
+
|
| 6 |
def stock_data (tick):
|
| 7 |
data = yf.download(tick, start=datetime.now() - timedelta(days=365),end=datetime.now())
|
| 8 |
return data.Close
|