数据未在熊猫中读取,进入运行时代

时间:2017-11-26 23:35:13

标签: python pandas split

我尝试运行此代码,此代码生成了时代,但为什么我的数据不可读?

def test(learning_rate=0.1, training_epochs=15,
         n_hidden=500, delay=6, k=1):
 print ('... loading data')


data_path = "./data.csv" 
DataFrame = pd.read_csv(data_path)


df = pd.DataFrame(np.random.randn(261, 2))
msk = np.random.rand(len(df)) < 0.8
train_X, train_y= df[msk]    
test_X, test_y= df[~msk]                
print ('... modeling')
rng = numpy.random.RandomState(123)


rbm = RBM(input=train_X, n_visible=28 * 28, n_hidden=500, numpy_rng=rng)

start_time = time.clock()

mean_cost_list = []

for epoch in range(training_epochs):
mean_cost = []
cost = rbm.get_cost_updates(lr=learning_rate, k=k)
print ('Training epoch %d, cost is ' % epoch, cost)

cost_plot(mean_cost_list)
end_time = time.clock()

pretraining_time = (end_time - start_time)

print(('Training took %f minutes' % (pretraining_time / 60.)))

return rbm

在运行时代导致无法读取数据的原因是什么? 我还尝试在不输入数据帧的情况下运行,并且epoch仍在运行...

0 个答案:

没有答案