-3
i=0
noofclasses = 2
alldata = ClassificationDataSet(400, 1, noofclasses)
while i<len(data):
    alldata.addSample(data[i],labels[i])
    i=i+1
tstdata_temp, trndata_temp = alldata.splitWithProportion( 10 )

tstdata = ClassificationDataSet(400, 1, noofclasses) 
for n in xrange(0, tstdata_temp.getLength()):
    tstdata.addSample( tstdata_temp.getSample(n)[0], tstdata_temp.getSample(n)[1] ) 

trndata = ClassificationDataSet(400, 1, noofclasses) 

for n in xrange(0, trndata_temp.getLength()): 
    trndata.addSample( trndata_temp.getSample(n)[0], trndata_temp.getSample(n)[1] ) 

trndata._convertToOneOfMany( )
tstdata._convertToOneOfMany( )

fnn = buildNetwork( trndata.indim, 10, trndata.outdim, outclass=SoftmaxLayer )
trainer = BackpropTrainer( fnn, dataset=trndata, momentum=0.1, verbose=True, weightdecay=0.01)
trainer.trainEpochs( 20 )

I have tried increasing number of Epochs and number of hidden neurons.Still no improvement in accuracy. 'data' is 400 dimensional (pixel values of 20x20 image) and labels look like this: [0,0,0,....1,1,1]

jack
  • 1
  • 6
  • "Labels look like this: [0,0,0,...,1,1,1]" ? Do you mean that you have single dimensional labels, so each element in your array is a label? – Andnp Jun 17 '16 at 18:15
  • Labels is single dimensional list but I'm using "trndata._convertToOneOfMany( )" which converts my labels to a two dimensional list which look like this: [(1,0),(1,0)......(0,1),(0,1)]. So ultimately my targets are two dimensional. – jack Jun 20 '16 at 05:11

1 Answers1

0

sorry, After adding bias term, Accuracy was pretty good.

fnn = buildNetwork( trndata.indim, 10, trndata.outdim, bias = True, outclass=SoftmaxLayer )

jack
  • 1
  • 6