Spaces:
Sleeping
Sleeping
ryanrahmadifa
commited on
Commit
·
c3b859b
1
Parent(s):
79e1719
Fixed error nonetype
Browse files- modules/data_preparation.py +6 -0
- page_2.py +1 -1
- req.txt +21 -0
- requirements.txt +2 -19
modules/data_preparation.py
CHANGED
@@ -20,6 +20,12 @@ def prepare_df(df, categories, date_filter):
|
|
20 |
|
21 |
#df['topic_verification'][(df.headline.str.contains('crude', case=False)) | df.body.str.contains('crude', case=False)] = 'Crude Oil'
|
22 |
|
|
|
|
|
|
|
|
|
|
|
|
|
23 |
try:
|
24 |
news_data = df[df['topic_verification'].isin(categories)]
|
25 |
|
|
|
20 |
|
21 |
#df['topic_verification'][(df.headline.str.contains('crude', case=False)) | df.body.str.contains('crude', case=False)] = 'Crude Oil'
|
22 |
|
23 |
+
# Check if categories is not empty before filtering
|
24 |
+
if categories:
|
25 |
+
news_data = df[df['topic_verification'].isin(categories)]
|
26 |
+
else:
|
27 |
+
news_data = df
|
28 |
+
|
29 |
try:
|
30 |
news_data = df[df['topic_verification'].isin(categories)]
|
31 |
|
page_2.py
CHANGED
@@ -60,4 +60,4 @@ img2 = Image.open(os.path.join('price_forecasting_ml',
|
|
60 |
'artifacts',
|
61 |
'crude_oil_df1ce299-117d-43c7-bcd5-7ecaeac0bc89',
|
62 |
'forecast_plot.jpg'))
|
63 |
-
st.image(img2, caption="Crude Oil Futures Price Forecasting -
|
|
|
60 |
'artifacts',
|
61 |
'crude_oil_df1ce299-117d-43c7-bcd5-7ecaeac0bc89',
|
62 |
'forecast_plot.jpg'))
|
63 |
+
st.image(img2, caption="Crude Oil Futures Price Forecasting - Multivariate (Horizon = 5)")
|
req.txt
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
seaborn
|
2 |
+
torch
|
3 |
+
torchvision
|
4 |
+
torchaudio
|
5 |
+
pyYAML
|
6 |
+
scipy
|
7 |
+
scikit-learn
|
8 |
+
packaging
|
9 |
+
pyWavelets
|
10 |
+
scipy
|
11 |
+
tiffile
|
12 |
+
pandas
|
13 |
+
nltk
|
14 |
+
ipykernel
|
15 |
+
matplotlib
|
16 |
+
streamlit
|
17 |
+
plotly
|
18 |
+
nbformat
|
19 |
+
wordcloud
|
20 |
+
openpyxl
|
21 |
+
neuralforecast
|
requirements.txt
CHANGED
@@ -1,21 +1,4 @@
|
|
1 |
-
|
2 |
-
torch
|
3 |
-
torchvision
|
4 |
-
torchaudio
|
5 |
-
pyYAML
|
6 |
-
scipy
|
7 |
-
scikit-learn
|
8 |
-
packaging
|
9 |
-
pyWavelets
|
10 |
-
scipy
|
11 |
-
tiffile
|
12 |
pandas
|
13 |
-
nltk
|
14 |
-
ipykernel
|
15 |
-
matplotlib
|
16 |
-
streamlit
|
17 |
plotly
|
18 |
-
|
19 |
-
wordcloud
|
20 |
-
openpyxl
|
21 |
-
neuralforecast
|
|
|
1 |
+
numpy
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
pandas
|
|
|
|
|
|
|
|
|
3 |
plotly
|
4 |
+
openpyxl
|
|
|
|
|
|