-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreprocessing_data.py
32 lines (21 loc) · 1.07 KB
/
preprocessing_data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import os
from helper import *
import warnings
warnings.filterwarnings('ignore')
def main():
cwd = os.getcwd()
inf = load_transform_data(data_file='DZ_Consumption_price_index.csv')
# print(inf.shape) (300, 1)
# print(inf.columns) CPI(%)
if not os.path.exists(os.path.join(cwd, "results")):
os.mkdir(cwd + "\\results")
if not os.path.exists(os.path.join(cwd+'\\results', "graphs")):
os.mkdir(cwd + "\\results\\graphs")
# graghs_path = cwd + "\\results\\graphs"
plot_description(time_series=inf, title='Algerian Inflation rate from 1998 to 2022 (y.o.y)',path = 'description_plot.png')
# plot_decomposition(time_series= inf,var_name='Inflation_rate',path = 'decomposition_plot.png')
# plot_heatmap(time_series=inf, name='CPI(%)',path ='cpi_inflation_heatmap.png')
data_split(time_series=inf)
plot_description(time_series=inf,title='Inflation rate (Train,Test,Vlidation)',path='train_val_test_dataset.png',if_split=True)
if __name__ == "__main__":
main()