Skip to content

Commit c99ac61

Browse files
committed
update
1 parent 01f2dc2 commit c99ac61

File tree

4 files changed

+4362
-4356
lines changed

4 files changed

+4362
-4356
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,6 @@ code-transformer/dataset/UrbanEV/*
99
!/code-transformer/dataset/UrbanEV/.gitkeep
1010

1111
result/main_exp/region/*
12-
!result/main_exp/region/.gitkeep
12+
!result/main_exp/region/.gitkeep
13+
14+
.SynologyWorkingDirectory

code/utils.py

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -56,16 +56,15 @@ def read_data(args):
5656
"""
5757

5858
# Load datasets
59-
occ = pd.read_csv(r'../data/occupancy.csv', header=0, index_col=0)
60-
duration = pd.read_csv(r'../data/duration.csv', header=0, index_col=0)
61-
volume = pd.read_csv(r'../data/volume.csv', header=0, index_col=0)
62-
e_price = pd.read_csv(r'../data/e_price.csv', index_col=0, header=0).values
63-
s_price = pd.read_csv(r'../data/s_price.csv', index_col=0, header=0).values
64-
adj = pd.read_csv('../data/adj.csv', header=0, index_col=0)
65-
adj.columns = adj.columns.astype(float).astype(int).astype(str)
59+
inf = pd.read_csv('../data/inf.csv', header=0, index_col=None)
60+
occ = pd.read_csv('../data/occupancy.csv', header=0, index_col=0)
61+
duration = pd.read_csv('../data/duration.csv', header=0, index_col=0)
62+
volume = pd.read_csv('../data/volume.csv', header=0, index_col=0)
63+
e_price = pd.read_csv('../data/e_price.csv', index_col=0, header=0).values
64+
s_price = pd.read_csv('../data/s_price.csv', index_col=0, header=0).values
65+
adj = pd.read_csv('../data/adj.csv', header=0, index_col=None)
6666
adj.index = adj.columns
67-
adj = adj.loc[occ.columns,occ.columns]
68-
adj.to_csv('../data/adj_filter.csv')
67+
6968
time = pd.to_datetime(occ.index)
7069

7170
feat = occ
@@ -74,7 +73,12 @@ def read_data(args):
7473
elif args.feat == 'volume':
7574
feat = volume
7675

77-
# Normalize e_price and s_price data
76+
# Normalize
77+
charge_count_dict = dict(zip(inf['TAZID'].astype(str), inf['charge_count']))
78+
for col in occ.columns:
79+
charge_count = charge_count_dict[col]
80+
occ[col] = occ[col] / charge_count
81+
7882
price_scaler = MinMaxScaler(feature_range=(0, 1))
7983
e_price = price_scaler.fit_transform(e_price)
8084
s_price = price_scaler.fit_transform(s_price)

0 commit comments

Comments
 (0)