code: def getPyBrainDataSetScalarEncoder(sequence, nTrain, encoderInput, encoderOutput,
                                     predictionStep=1, useTimeOfDay=True, useDayOfWeek=True):
    
    print "generate a pybrain dataset of sequences"
    print "the training data contains ", str(nTrain-predictionStep), "records"
  
    if encoderInput is None:
      inDim = 1 + int(useTimeOfDay) + int(useDayOfWeek)
    else:
      inDim = encoderInput.n + int(useTimeOfDay) + int(useDayOfWeek)
  
    if encoderOutput is None:
      outDim = 1
    else:
      outDim = encoderOutput.n
  
    ds = SequentialDataSet(inDim, outDim)
    if useTimeOfDay:
      print "include time of day as input field"
    if useDayOfWeek:
      print "include day of week as input field"
  
    for i in xrange(nTrain-predictionStep):
  
      sample = getSingleSample(i, sequence, useTimeOfDay, useDayOfWeek)
  
      if encoderOutput is None:
        dataSDROutput = [sequence['normdata'][i+predictionStep]]
      else:
        dataSDROutput = encoderOutput.encode(sequence['data'][i+predictionStep])
  
  
      ds.addSample(sample, dataSDROutput)
  
    return ds
docs: Use scalar encoder for the data
    :param sequence:
    :param nTrain:
    :param predictionStep:
    :param useTimeOfDay:
    :param useDayOfWeek:
    :return: