def initializeClassifiers(Nelements, encoder):
  cla = CLAClassifier(steps=[0])

  nn_classifier = NeuralNetClassifier(numInputs=encoder.n,
                                      steps=[0], alpha=0.1)

  patternNZ = list(numpy.where(encoder.encode(Nelements-1))[0])
  classification = {'bucketIdx': Nelements-1, 'actValue': Nelements-1}

  # feed in the pattern with the highest bucket index
  claRetval = cla.compute(0, patternNZ, classification,
                           learn=True, infer=True)
  nnRetval = nn_classifier.compute(0, patternNZ, classification,
                                    learn=True, infer=True)
  return cla, nn_classifier
    predictiveCells = tm.predictiveCells
    predCellNum.append(len(predictiveCells))
    predColumn = np.array(list(predictiveCells)) / tm.cellsPerColumn

    patternNZ = tpOutput.reshape(-1).nonzero()[0]
    activeColumn = patternNZ / tm.cellsPerColumn
    activeCellNum.append(len(patternNZ))

    predictedActiveColumns = np.intersect1d(prePredictiveColumn, activeColumn)
    predictedActiveColumnsNum.append(len(predictedActiveColumns))

    # fed input to the new classifier
    classification = {'bucketIdx': result.classifierInput.bucketIndex,
                      'actValue': result.classifierInput.dataRow}
    nnRetval = nn_classifier.compute(i, patternNZ, classification,
                                     learn=True, infer=True)
    nnPrediction = nnRetval['actualValues'][np.argmax(nnRetval[5])]
    predictDataNN.append(nnPrediction)
    output.write([i], [inputRecord[predictedField]], [float(nnPrediction)])

    likelihoodsVecAllNN[0:len(nnRetval[5]), i] = nnRetval[5]

    result.metrics = metricsManager.update(result)

    negLL = result.metrics["multiStepBestPredictions:multiStep:"
                           "errorMetric='negativeLogLikelihood':steps=%d:window=1000:"
                           "field=%s" % (_options.stepsAhead, predictedField)]
    if i % 100 == 0 and i > 0:
      negLL = result.metrics["multiStepBestPredictions:multiStep:"
                             "errorMetric='negativeLogLikelihood':steps=%d:window=1000:"
                             "field=%s" % (_options.stepsAhead, predictedField)]