|
@@ -98,7 +98,7 @@ class CustomDataHandler(object):
|
|
|
train_num = int(len(feature_data))
|
|
|
label_features_power = [col_time, target] if is_train is True else [col_time, target]
|
|
|
label_features_zone = self.opt.zone
|
|
|
- nwp_cs = self.opt.features
|
|
|
+ nwp_cs = [x for x in self.opt.features if x not in self.opt.zone]
|
|
|
nwp = [feature_data.loc[i:i + time_step_loc, nwp_cs].reset_index(drop=True) for i in range(train_num - time_step*time_series + 1)]
|
|
|
labels_power = [feature_data.loc[i:i + time_step_loc, label_features_power].reset_index(drop=True) for i in range(train_num - time_step*time_series + 1)]
|
|
|
labels_zone = [feature_data.loc[i:i + time_step_loc, label_features_zone].reset_index(drop=True) for i in range(train_num - time_step*time_series + 1)]
|
|
@@ -202,7 +202,7 @@ class CustomDataHandler(object):
|
|
|
if 'is_limit' in data.columns:
|
|
|
data = data[data['is_limit'] == False]
|
|
|
# 筛选特征,数值化,排序
|
|
|
- train_data = data[[col_time] + features + [target]]
|
|
|
+ train_data = data[[col_time] + features + [target] + self.opt.zone]
|
|
|
train_data = train_data.applymap(lambda x: float(x.to_decimal()) if isinstance(x, Decimal128) else float(x) if isinstance(x, numbers.Number) else x)
|
|
|
train_data = train_data.sort_values(by=col_time)
|
|
|
# 清洗特征平均缺失率大于20%的天
|