Ejemplo n.º 1
0
def add_simu_data(data,length,rangelow=[-0.372,-0.859,1.9,0.,1.9],rangehigh=[0.372,0.859,2.0,0.,2.1]):
    #simu
    array=np.random.random((length,len(rangelow)))
    array=(np.array(rangehigh)-np.array(rangelow))*array+np.array(rangelow)
    pred=cf.control_func(array,array.shape[0])[:,None]
    array=np.hstack((array,pred))
    #combine
    data=np.vstack((data,array))
    return data
Ejemplo n.º 2
0
def add_simu_data(data,length,rangelow=[-0.372,-0.859,1.9,0.,1.9],rangehigh=[0.372,0.859,2.0,0.,2.1]):
    #simu
    array=np.random.random((length,len(rangelow)))
    array=(np.array(rangehigh)-np.array(rangelow))*array+np.array(rangelow)
    pred=cf.control_func(array,array.shape[0])[:,None]
    array=np.hstack((array,pred))
    #combine
    data=np.vstack((data,array))
    data=np.roll(data,array.shape[0]*4/5,axis=0)
    #我一直改的上面这一句,发现4/5,比较好,本来是3/4感觉拿到数据容易过拟合,那边取了7/8
    #其实就是那边后边0的部分留的太多,validation就会小很多,误以为好
    return data