Main.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:pythonml 作者: nicholastoddsmith 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号