@classmethod<EOL><INDENT>def read(cls, proto):<DEDENT>
obj = object.__new__(cls)<EOL>super(HTMPredictionModel, obj).__init__(proto=proto.modelBase)<EOL>obj._minLikelihoodThreshold = round(proto.minLikelihoodThreshold,<EOL>EPSILON_ROUND)<EOL>obj._maxPredictionsPerStep = proto.maxPredictionsPerStep<EOL>network = Network.read(proto.network)<EOL>obj._hasSP = ("<STR_LIT>" in network.regions)<EOL>obj._hasTP = ("<STR_LIT>" in network.regions)<EOL>obj._hasCL = ("<STR_LIT>" in network.regions)<EOL>obj._netInfo = NetworkInfo(net=network, statsCollectors=[])<EOL>obj.__spLearningEnabled = bool(proto.spLearningEnabled)<EOL>obj.__tpLearningEnabled = bool(proto.tpLearningEnabled)<EOL>obj.__numRunCalls = proto.numRunCalls<EOL>obj._classifierInputEncoder = None<EOL>if proto.predictedFieldIdx.which() == "<STR_LIT:none>":<EOL><INDENT>obj._predictedFieldIdx = None<EOL><DEDENT>else:<EOL><INDENT>obj._predictedFieldIdx = proto.predictedFieldIdx.value<EOL><DEDENT>if proto.predictedFieldName.which() == "<STR_LIT:none>":<EOL><INDENT>obj._predictedFieldName = None<EOL><DEDENT>else:<EOL><INDENT>obj._predictedFieldName = proto.predictedFieldName.value<EOL><DEDENT>obj._numFields = proto.numFields<EOL>if proto.numFields.which() == "<STR_LIT:none>":<EOL><INDENT>obj._numFields = None<EOL><DEDENT>else:<EOL><INDENT>obj._numFields = proto.numFields.value<EOL><DEDENT>obj.__trainSPNetOnlyIfRequested = proto.trainSPNetOnlyIfRequested<EOL>obj.__finishedLearning = proto.finishedLearning<EOL>obj._input = None<EOL>sensor = network.regions['<STR_LIT>'].getSelf()<EOL>sensor.dataSource = DataBuffer()<EOL>network.initialize()<EOL>obj.__logger = initLogger(obj)<EOL>obj.__logger.debug("<STR_LIT>" % obj.__myClassName)<EOL>obj.__restoringFromState = False<EOL>obj.__restoringFromV1 = False<EOL>return obj<EOL>
:param proto: capnp HTMPredictionModelProto message reader