whats the diference between train, validation and test set, in neural networks?
- by Daniel
Im using this library
http://pastebin.com/raw.php?i=aMtVv4RZ
to implement a learning agent.
I have generated the train cases, but i dont know for sure what are the validation and test sets, the teacher says:
70% should be train cases, 10% will be test cases and the rest 20% should be validation cases.
Thanks.
edit
i have this code, for training.. but i have no ideia when to stop training..
def train(self, train, validation, N=0.3, M=0.1):
# N: learning rate
# M: momentum factor
accuracy = list()
while(True):
error = 0.0
for p in train:
input, target = p
self.update(input)
error = error + self.backPropagate(target, N, M)
print "validation"
total = 0
for p in validation:
input, target = p
output = self.update(input)
total += sum([abs(target - output) for target, output in zip(target, output)]) #calculates sum of absolute diference between target and output
accuracy.append(total)
print min(accuracy)
print sum(accuracy[-5:])/5
#if i % 100 == 0:
print 'error %-14f' % error
if ? < ?:
break