关于

2019-03-27  本文已影响0人  Dorrrris
  1. 不知道为什么pop_size要取36
  2. 不知道为什么要reframed.drop column index在18*8之后的七个
  3. 梳理一下函数的顺序就是:
# Initialize random population
def get_first_pop(pop_size, param_num, encode_length)
# Decoding parameter
def encode(individual_code)
# Decoding parameter combination
def get_param(individual_code,param_num, encode_length)
# Decoding population
def pop2param(pop) 没用
# Initialization parameter population
def get_first_param(pop_size, param_num, encode_length)
# Get random index
def get_cross_seg_id(param_num)
# Crossover
def cross_over(individual_1,individual_2)
# variation 
def variation(individual_code)
# Population grouping
def pop2group(pop,group_num)
# Conversion of parameter sequences to key values
def c_pop2str(c_pop)
# select
def select(pop,n_selected,step)
# Population reconstruction
def pop_reconstruct(pop_selected,target_num)
# preprocessing
def series_to_supervised(data, n_in = 1, n_out = 1, dropnan = True)
# produce attention weights 
def get_attenton_rate_df(param,df,n_feature,time_step)
# Get the training error of the attention weight on the validation set
def get_rmse(param,reframed)

def search_best_attention_rate(max_step)
```
series_to_supervised(scaled, 18, 1)
```

这里18和1不知道是怎么来的!!??!?!?
函数的作用:把整个表格向下移动i行,(移动18次,从18开始移,然后17,16....)这样前面肯定会有空出来的行,就写nan;这样每一次移动完的表格(dataframe格式)存入cols这个list当中。因为shift这个操作做了18次,所以最后cols的列数就是18*属性个数,列的名称分别是var1(t-18) var2(t-18)... var11(t-18)...var1(t) var2(t)... var11(t)

search_best_attention_rate部分 调用get_first_param(36,18,6)select(pop,6,step)pop_reconstruct(selected[0],36)
进行epoch:20

上一篇下一篇

猜你喜欢

热点阅读