def MakeBenchDataFeature(R, A, Y, nt, fn):
#Divide samples into nt pieces on for each i run benchmark with chunks 0, 1, ..., i
step = A.shape[1] // nt
TT = np.zeros((nt, 3))
for i in range(1, nt):
#Number of features
TT[i, 0] = len(range(0, (i * step)))
print('{:8d} feature benchmark.'.format(int(TT[i, 0])))
#Training and testing times respectively
TT[i, 1], TT[i, 2] = RunBenchmark(R, A[:, 0:(i * step)], Y[:, 0:(i * step)])
#Save benchmark data to csv file
np.savetxt(fn, TT, delimiter = ',', header = 'Samples,Train,Test')
#R: Regressor network to use
#A: The sample data matrix
#Y: Target data matrix
#nt: Number of times to divide the sample matrix
#fn: File name to write results
评论列表
文章目录