class_docstr: A simple end to end to end test of a RecordSensor->SDR Classifier network,
  where the data records each contain multiple categories.
class_docstr_tok: ["A","simple","end","to","end","to","end","test","of","a","RecordSensor-",">","SDR","Classifier","network",",","where","the","data","records","each","contain","multiple","categories","."]
code: def testHelloWorldPrediction(self):
      text = "hello world."
      categories = list("abcdefghijklmnopqrstuvwxyz 1234567890.")
      colsPerChar = 11
      numColumns = (len(categories) + 1) * colsPerChar
  
      MODEL_PARAMS = {
          "model": "HTMPrediction",
          "version": 1,
          "predictAheadTime": None,
          "modelParams": {
              "inferenceType": "TemporalMultiStep",
              "sensorParams": {
                  "verbosity": 0,
                  "encoders": {
                      "token": {
                          "fieldname": "token",
                          "name": "token",
                          "type": "CategoryEncoder",
                          "categoryList": categories,
                          "w": colsPerChar,
                          "forced": True,
                      }
                  },
                  "sensorAutoReset": None,
              },
              "spEnable": False,
              "spParams": {
                  "spVerbosity": 0,
                  "globalInhibition": 1,
                  "columnCount": 2048,
                  "inputWidth": 0,
                  "numActiveColumnsPerInhArea": 40,
                  "seed": 1956,
                  "columnDimensions": 0.5,
                  "synPermConnected": 0.1,
                  "synPermActiveInc": 0.1,
                  "synPermInactiveDec": 0.01,
                  "boostStrength": 0.0,
              },
              "tmEnable": True,
              "tmParams": {
                  "verbosity": 0,
                  "columnCount": numColumns,
                  "cellsPerColumn": 16,
                  "inputWidth": numColumns,
                  "seed": 1960,
                  "temporalImp": "tm_cpp",
                  "newSynapseCount": 6,
                  "maxSynapsesPerSegment": 11,
                  "maxSegmentsPerCell": 32,
                  "initialPerm": 0.21,
                  "permanenceInc": 0.1,
                  "permanenceDec": 0.05,
                  "globalDecay": 0.0,
                  "maxAge": 0,
                  "minThreshold": 3,
                  "activationThreshold": 5,
                  "outputType": "normal",
              },
              "clParams": {
                  "implementation": "py",
                  "regionName": "SDRClassifierRegion",
                  "verbosity": 0,
                  "alpha": 0.1,
                  "steps": "1",
              },
              "trainSPNetOnlyIfRequested": False,
          },
      }
  
      model = ModelFactory.create(MODEL_PARAMS)
      model.enableInference({"predictedField": "token"})
      model.enableLearning()
  
      # train
      prediction = None
      for rpt in xrange(20):
          for token in text:
              if prediction is not None:
                  if rpt > 15:
                      self.assertEqual(prediction, token)
              modelInput = {"token": token}
              result = model.run(modelInput)
              prediction = sorted(
                  result.inferences["multiStepPredictions"][1].items(),
                  key=itemgetter(1),
                  reverse=True,
              )[0][0]
          model.resetSequenceStates()
          prediction = None
  
file_path: nupic-legacy/tests/integration/nupic/regions/single_step_sdr_classifier_test.py
imports: from operator import itemgetter
  import os
  import tempfile
  import unittest
  import numpy
  from datetime import datetime
  from nupic.data.file_record_stream import FileRecordStream
  from nupic.encoders import MultiEncoder, ScalarEncoder
  from nupic.engine import Network
  from nupic.frameworks.opf.model_factory import ModelFactory
label_desc: Use image node_id 3 for calling the SingleStepSDRClassifierTest obj's underlying member method code with example usage: obj.testHelloWorldPrediction() without return types