def __init__(self,<EOL>sensorParams={},<EOL>inferenceType=InferenceType.TemporalNextStep,<EOL>spEnable=True,<EOL>spParams={},<EOL>trainSPNetOnlyIfRequested=False,<EOL>tmEnable=True,<EOL>tmParams={},<EOL>clEnable=True,<EOL>clParams={},<EOL>anomalyParams={},<EOL>minLikelihoodThreshold=DEFAULT_LIKELIHOOD_THRESHOLD,<EOL>maxPredictionsPerStep=DEFAULT_MAX_PREDICTIONS_PER_STEP,<EOL>network=None,<EOL>baseProto=None):
if not inferenceType in self.__supportedInferenceKindSet:<EOL><INDENT>raise ValueError("<STR_LIT>".format(self.__class__, inferenceType))<EOL><DEDENT>if baseProto is None:<EOL><INDENT>super(HTMPredictionModel, self).__init__(inferenceType)<EOL><DEDENT>else:<EOL><INDENT>super(HTMPredictionModel, self).__init__(proto=baseProto)<EOL><DEDENT>self.__restoringFromState = False<EOL>self.__restoringFromV1 = False<EOL>self.__logger = initLogger(self)<EOL>self.__logger.debug("<STR_LIT>" % self.__myClassName)<EOL>self._minLikelihoodThreshold = minLikelihoodThreshold<EOL>self._maxPredictionsPerStep = maxPredictionsPerStep<EOL>self.__spLearningEnabled = bool(spEnable)<EOL>self.__tpLearningEnabled = bool(tmEnable)<EOL>if not InferenceType.isTemporal(self.getInferenceType())or self.getInferenceType() == InferenceType.NontemporalMultiStep:<EOL><INDENT>tmEnable = False<EOL><DEDENT>self._netInfo = None<EOL>self._hasSP = spEnable<EOL>self._hasTP = tmEnable<EOL>self._hasCL = clEnable<EOL>self._classifierInputEncoder = None<EOL>self._predictedFieldIdx = None<EOL>self._predictedFieldName = None<EOL>self._numFields = None<EOL>if network is not None:<EOL><INDENT>self._netInfo = NetworkInfo(net=network, statsCollectors=[])<EOL><DEDENT>else:<EOL><INDENT>self._netInfo = self.__createHTMNetwork(<EOL>sensorParams, spEnable, spParams, tmEnable, tmParams, clEnable,<EOL>clParams, anomalyParams)<EOL><DEDENT>if self.getInferenceType() == InferenceType.NontemporalAnomaly:<EOL><INDENT>self._getSPRegion().setParameter("<STR_LIT>", True)<EOL><DEDENT>if self.getInferenceType() == InferenceType.TemporalAnomaly:<EOL><INDENT>self._getTPRegion().setParameter("<STR_LIT>", True)<EOL><DEDENT>self.__trainSPNetOnlyIfRequested = trainSPNetOnlyIfRequested<EOL>self.__numRunCalls = <NUM_LIT:0><EOL>self.__finishedLearning = False<EOL>self.__logger.debug("<STR_LIT>" % self.__class__.__name__)<EOL>self._input = None<EOL>return<EOL>
:param network: if not None, the deserialized nupic.engine.Network instance
                to use instead of creating a new Network
:param baseProto: if not None, capnp ModelProto message reader for
                  deserializing; supersedes inferenceType