title: Pybrain neural network: _convertToOneOfMany error
body: <p>I am new to Pybrain and trying to put together a neural network. First, I came across <a href="https://stackoverflow.com/questions/27887936/attributeerror-using-pybrain-splitwithportion-object-type-changed">the error described here</a>: </p>
  
  <pre><code>AttributeError: 'SupervisedDataSet' object has no attribute '_convertToOneOfMany'
  </code></pre>
  
  <p>I tried the workaround described in the accepted answer of that thread. While it seems it works, it now gives me a new error. These are the relevant chunks of my code:</p>
  
  <p>The part that reads the file into a classification dataset. 3 input attributes, 2 classes, splits the read array, first 3 columns to 'input' and the last one to 'target':</p>
  
  <pre><code>ds = ClassificationDataSet(inp=3, target=1, nb_classes=2)
  tf = open('datafile.txt')
  a = np.loadtxt(tf) 
  a = np.hsplit(a, (3,4))
  ds.setField('input', a[0])
  ds.setField('target', a[1])
  </code></pre>
  
  <p>The part that builds a simple network, pretty standard for pybrain:</p>
  
  <pre><code>inLayer = SigmoidLayer(3)
  hiddenLayer = SigmoidLayer(5)
  outLayer = SigmoidLayer(2)
  
  fnn.addInputModule(inLayer)
  fnn.addModule(hiddenLayer)
  fnn.addOutputModule(outLayer)
  
  in_to_hidden = FullConnection(inLayer, hiddenLayer)
  hidden_to_out = FullConnection(hiddenLayer, outLayer)
  
  fnn.addConnection(in_to_hidden)
  fnn.addConnection(hidden_to_out)
  
  fnn.sortModules()
  </code></pre>
  
  <p>This is the workaround, as described above:</p>
  
  <pre><code>tstdata_temp, trndata_temp = ds.splitWithProportion(0.25)
  
  tstdata = ClassificationDataSet(3, target=1, nb_classes=2)
  for n in xrange(0, tstdata_temp.getLength()):
       tstdata.addSample( tstdata_temp.getSample(n)[0], tstdata_temp.getSample(n)[1] )
  
  trndata = ClassificationDataSet(3, target=1, nb_classes=2)
  for n in xrange(0, trndata_temp.getLength()):
       trndata.addSample( trndata_temp.getSample(n)[0], trndata_temp.getSample(n)[1] )
  
  trndata._convertToOneOfMany()
  tstdata._convertToOneOfMany()
  </code></pre>
  
  <p>And this is the error I am getting on the first convert line:</p>
  
  <pre><code>IndexError: index 2 is out of bounds for axis 1 with size 2
  </code></pre>