def runModel(self, modelID, jobID, modelParams, modelParamsHash,<EOL>jobsDAO, modelCheckpointGUID):
<EOL>if not self._createCheckpoints:<EOL><INDENT>modelCheckpointGUID = None<EOL><DEDENT>self._resultsDB.update(modelID=modelID,<EOL>modelParams=modelParams,<EOL>modelParamsHash=modelParamsHash,<EOL>metricResult = None,<EOL>completed = False,<EOL>completionReason = None,<EOL>matured = False,<EOL>numRecords = <NUM_LIT:0>)<EOL>structuredParams = modelParams['<STR_LIT>']<EOL>if self.logger.getEffectiveLevel() <= logging.DEBUG:<EOL><INDENT>self.logger.debug("<STR_LIT>" %(pprint.pformat(modelParams, indent=<NUM_LIT:4>), modelID))<EOL><DEDENT>cpuTimeStart = time.clock()<EOL>logLevel = self.logger.getEffectiveLevel()<EOL>try:<EOL><INDENT>if self._dummyModel is None or self._dummyModel is False:<EOL><INDENT>(cmpReason, cmpMsg) = runModelGivenBaseAndParams(<EOL>modelID=modelID,<EOL>jobID=jobID,<EOL>baseDescription=self._baseDescription,<EOL>params=structuredParams,<EOL>predictedField=self._predictedField,<EOL>reportKeys=self._reportKeys,<EOL>optimizeKey=self._optimizeKey,<EOL>jobsDAO=jobsDAO,<EOL>modelCheckpointGUID=modelCheckpointGUID,<EOL>logLevel=logLevel,<EOL>predictionCacheMaxRecords=self._predictionCacheMaxRecords)<EOL><DEDENT>else:<EOL><INDENT>dummyParams = dict(self._dummyModel)<EOL>dummyParams['<STR_LIT>'] = structuredParams<EOL>if self._dummyModelParamsFunc is not None:<EOL><INDENT>permInfo = dict(structuredParams)<EOL>permInfo ['<STR_LIT>'] = modelParams['<STR_LIT>']['<STR_LIT>']<EOL>dummyParams.update(self._dummyModelParamsFunc(permInfo))<EOL><DEDENT>(cmpReason, cmpMsg) = runDummyModel(<EOL>modelID=modelID,<EOL>jobID=jobID,<EOL>params=dummyParams,<EOL>predictedField=self._predictedField,<EOL>reportKeys=self._reportKeys,<EOL>optimizeKey=self._optimizeKey,<EOL>jobsDAO=jobsDAO,<EOL>modelCheckpointGUID=modelCheckpointGUID,<EOL>logLevel=logLevel,<EOL>predictionCacheMaxRecords=self._predictionCacheMaxRecords)<EOL><DEDENT>jobsDAO.modelSetCompleted(modelID,<EOL>completionReason = cmpReason,<EOL>completionMsg = cmpMsg,<EOL>cpuTime = time.clock() - cpuTimeStart)<EOL><DEDENT>except InvalidConnectionException as e:<EOL><INDENT>self.logger.warn("<STR_LIT:%s>", e)<EOL><DEDENT>
Run the given model.

        This runs the model described by 'modelParams'. Periodically, it updates
        the results seen on the model to the model database using the databaseAO
        (database Access Object) methods.

        Parameters:
        -------------------------------------------------------------------------
        modelID:             ID of this model in models table

        jobID:               ID for this hypersearch job in the jobs table

        modelParams:         parameters of this specific model
                             modelParams is a dictionary containing the name/value
                             pairs of each variable we are permuting over. Note that
                             variables within an encoder spec have their name
                             structure as:
                               <encoderName>.<encodrVarName>

        modelParamsHash:     hash of modelParamValues

        jobsDAO              jobs data access object - the interface to the jobs
                              database where model information is stored

        modelCheckpointGUID: A persistent, globally-unique identifier for
                              constructing the model checkpoint key