features_selected = [ feat for feat, weigh in zip(list(df_weight_agg.index), df_weight_agg.values) if weigh > threshold ] features_selected_dic = {} for station_name in station_name_list: features_selected_dic[station_name] = features_selected with open( os.path.join(dir_log, '{}_selected_features.json'.format(method)), 'w') as f: json.dump(features_selected_dic, f) if __name__ == '__main__': tag = tag_path(os.path.abspath(__file__), 2) config = DefaultConfig() config.single_step = False target = 'V' method = 'ridge' dir_log = os.path.join(DIR_LOG, tag, target) make_dir(dir_log) data_generator_list = [] for obs_data_path in config.obs_data_path_list: data_generator = DataGenerator(config.period, config.window, path=obs_data_path, norm=config.norm, x_divide_std=config.x_divide_std)
def get_tag(file): return tag_path(os.path.abspath(file), 2)