所以我對python和pybrain很新,但是我在網上找到了一個代碼並在其上運行了我自己的數據。當我看着Python Shell中我看到的是pybrain什麼是總誤差,它告訴我們什麼
Total error: 0.119794950183
Total error: 0.120078064472
Total error: 0.119334171755
Total error: 0.119215954708
Total error: 0.119876371059
Total error: 0.119621091587
Total error: 0.119983293587
Total error: 0.119849213731
Total error: 0.119638354788
Total error: 0.119574076444
Total error: 0.119634911454
Total error: 0.119601510912
Total error: 0.119665039573
Total error: 0.11944303853
Total error: 0.11950617361
Total error: 0.120088611572
Total error: 0.119774446939
Total error: 0.120016814426
Total error: 0.119605678505
Total error: 0.119998864263
Total error: 0.120071472045
Total error: 0.11973079242
Total error: 0.119790825048
Total error: 0.119558913137
Total error: 0.12024443015
Total error: 0.119525196587
Total error: 0.12008456943
Total error: 0.119641361568
Total error: 0.119745707444
Total error: 0.120065315199
1)什麼總誤差均值和它在幹什麼
這裏是代碼
from pybrain.datasets import SupervisedDataSet
from pybrain.tools.shortcuts import buildNetwork
from pybrain.supervised.trainers import BackpropTrainer
from pybrain.datasets import ClassificationDataSet
from pybrain.utilities import percentError
from pybrain.tools.shortcuts import buildNetwork
from pybrain.supervised.trainers import BackpropTrainer
from pybrain.structure.modules import SoftmaxLayer
from pylab import ion, ioff, figure, draw, contourf, clf, show, hold, plot
from scipy import diag, arange, meshgrid, where
from numpy.random import multivariate_normal
ds = SupervisedDataSet(2,1)
tf = open('weather.csv','r')
for line in tf.readlines():
try:
data = [float(x) for x in line.strip().split(',') if x != '']
indata = tuple(data[:2])
outdata = tuple(data[2:])
ds.addSample(indata,outdata)
except ValueError,e:
print "error",e,"on line"
n = buildNetwork(ds.indim,8,8,ds.outdim,recurrent=True)
t = BackpropTrainer(n,learningrate=0.01,momentum=0.5,verbose=True)
t.trainOnDataset(ds,5000)
t.testOnData(verbose=True)
那麼你的代碼在哪裏? – Kasramvd 2014-09-21 13:35:24
你是否適合PyBrain的某種模型?例如,如果您擬合迴歸模型,這可能是平方誤差的總和,有時稱爲總誤差。這可能是一個錯誤術語,對於您試圖適合的任何模型類而言都是常見的。 – ely 2014-09-21 13:44:35
我添加了代碼 – 2014-09-21 13:50:19