Description API¶
This file describes the Description API interface of the Online Prediction Framework (OPF).
The Description API interface encapsulates the following two important sets of configuration parameters in OPF
- model creation parameters (via getDescription)
- task control parameters (via getExperimentTasks)
The description class objects instantiated in description.py
implements the functionality by subclassing the Description API interface.
This allows description.py
to be generic and oblivious to the specific
experiments.
-
class
nupic.frameworks.opf.exp_description_api.
DescriptionIface
(modelConfig, control)¶ This is the base interface class for description API classes which provide OPF configuration parameters.
This mechanism abstracts description API from the specific description objects created by the individual users.
TODO: logging interface?
Parameters: - modelConfig – (dict) Holds user-defined settings for model creation. See OPF here for config dict documentation.
- control – (dict) How the model is to be run. The schema of this dictionary depends on the ‘environment’ parameter, which specifies the context in which the model is being run.
-
convertNupicEnvToOPF
()¶ Converts the control element from Nupic format to a default OPF format with 1 task. This is useful when you have a base description file that you want to run both permutations on (which requires the Nupic environment format) and single OPF experiments on (which requires the OPF format).
-
getModelControl
()¶ Returns the task instances of the experiment description.
Returns: (dict) describing how the model is to be run
-
getModelDescription
()¶ Returns: the model creation parameters based on the settings in the config dictionary.
-
normalizeStreamSources
()¶ Inspects the control task and updates any stream sources it finds that are not absolute paths into paths generated by pkg_resources relative to nupic.datafiles.
-
class
nupic.frameworks.opf.exp_description_api.
ExperimentDescriptionAPI
(modelConfig, control)¶ Bases:
nupic.frameworks.opf.exp_description_api.DescriptionIface
TODO: Document this.
-
convertNupicEnvToOPF
()¶ TODO: document
-
normalizeStreamSource
(stream)¶ TODO: document :param stream:
-
normalizeStreamSources
()¶ TODO: document
-