self.__writer.append(modelResult)<EOL>return<EOL>

Emit a input/prediction pair, if possible.

        modelResult:    An opf_utils.ModelResult object that contains the model input
                        and output for the current timestep.


self.__logger = logging.getLogger("<STR_LIT:.>".join(<EOL>['<STR_LIT>', self.__class__.__module__, self.__class__.__name__]))<EOL>self.__writer = writer<EOL>self.__inferenceShifter = InferenceShifter()<EOL>return<EOL>

writer:       Non-temporal prediction log writer conforming to
              PredictionWriterIface interface.


self.__writer.append(self.__inferenceShifter.shift(modelResult))<EOL>

Queue up the T(i+1) prediction value and emit a T(i)
        input/prediction pair, if possible.  E.g., if the previous T(i-1)
        iteration was learn-only, then we would not have a T(i) prediction in our
        FIFO and would not be able to emit a meaningful input/prediction
        pair.

        modelResult:    An opf_utils.ModelResult object that contains the model input
                        and output for the current timestep.


return os.path.abspath(os.path.join(experimentDir, "<STR_LIT>"))<EOL>

experimentDir:  experiment directory path that contains description.py

Returns: experiment inference directory path string (the path may not
          yet exist - see createExperimentInferenceDir())


path = cls.getExperimentInferenceDirPath(experimentDir)<EOL>cls.makeDirectory(path)<EOL>return path<EOL>

Creates the inference output directory for the given experiment

        experimentDir:  experiment directory path that contains description.py

        Returns:  path of the inference output directory


<EOL>try:<EOL><INDENT>os.makedirs(path)<EOL><DEDENT>except OSError as e:<EOL><INDENT>if e.errno == os.errno.EEXIST:<EOL><INDENT>pass<EOL><DEDENT>else:<EOL><INDENT>raise<EOL><DEDENT><DEDENT>return<EOL>

Makes directory for the given directory path if it doesn't already exist
        in the filesystem.  Creates all requested directory segments as needed.

        path:   path of the directory to create.

        Returns:      nothing


Closes connect to output store and cleans up any resources associated
        with writing.


Emits a set of inputs data, inferences, and metrics from a model
        resulting from a single record.

        :param modelResult: (:class:`nupic.frameworks.opf.opf_utils.ModelResult`)
               contains the model input and output for the current timestep.


@abstractmethod<EOL><INDENT>def writeRecords(self, modelResults, progressCB=None):<DEDENT>

Same as :meth:`writeRecord`, but emits multiple rows in one shot.

:param modelResults: (list) of
       :class:`nupic.frameworks.opf.opf_utils.ModelResult` objects, each
       represents one record.
:param progressCB: (func) optional callback method that will be called after
       each batch of records is written.


Sets which metrics should be written to the prediction log.

        :param metricNames: (list) metric names that match the labels of the
                          metrics that should be written to the prediction log


@abstractmethod<EOL><INDENT>def checkpoint(self, checkpointSink, maxRows):<DEDENT>

Save a checkpoint of the prediction output stream. The checkpoint
        comprises up to maxRows of the most recent inference records.

        :param checkpointSink: A File-like object where predictions checkpoint data,
               if any, will be stored.
        :param maxRows: (int) Maximum number of most recent inference rows to
               checkpoint.


if cls.__logger is None:<EOL><INDENT>cls.__logger = opf_utils.initLogger(cls)<EOL><DEDENT>return cls.__logger<EOL>

Get the logger for this object.

        :returns: (Logger) A Logger object.


logger = ModelFactory.__getLogger()<EOL>logger.setLevel(logLevel)<EOL>logger.debug("<STR_LIT>", modelConfig)<EOL>modelClass = None<EOL>if modelConfig['<STR_LIT>'] == "<STR_LIT>":<EOL><INDENT>modelClass = HTMPredictionModel<EOL><DEDENT>elif modelConfig['<STR_LIT>'] == "<STR_LIT>":<EOL><INDENT>modelClass = TwoGramModel<EOL><DEDENT>elif modelConfig['<STR_LIT>'] == "<STR_LIT>":<EOL><INDENT>modelClass = PreviousValueModel<EOL><DEDENT>else:<EOL><INDENT>raise Exception("<STR_LIT>" %modelConfig['<STR_LIT>'])<EOL><DEDENT>return modelClass(**modelConfig['<STR_LIT>'])<EOL>

Create a new model instance, given a description dictionary.

        :param modelConfig: (dict)
               A dictionary describing the current model,
               `described here <../../quick-start/example-model-params.html>`_.

        :param logLevel: (int) The level of logging output that should be generated

        :raises Exception: Unsupported model type

        :returns: :class:`nupic.frameworks.opf.model.Model`


if newSerialization:<EOL><INDENT>return HTMPredictionModel.readFromCheckpoint(savedModelDir)<EOL><DEDENT>else:<EOL><INDENT>return Model.load(savedModelDir)<EOL><DEDENT>

Load saved model.

        :param savedModelDir: (string)
               Directory of where the experiment is to be or was saved
        :returns: (:class:`nupic.frameworks.opf.model.Model`) The loaded model
                  instance.