def getFieldContributions(self):
<EOL>if self._hsObj._fixedFields is not None:<EOL><INDENT>return dict(), dict()<EOL><DEDENT>predictedEncoderName = self._hsObj._predictedFieldEncoder<EOL>fieldScores = []<EOL>for swarmId, info in self._state['<STR_LIT>'].items():<EOL><INDENT>encodersUsed = swarmId.split('<STR_LIT:.>')<EOL>if len(encodersUsed) != <NUM_LIT:1>:<EOL><INDENT>continue<EOL><DEDENT>field = self.getEncoderNameFromKey(encodersUsed[<NUM_LIT:0>])<EOL>bestScore = info['<STR_LIT>']<EOL>if bestScore is None:<EOL><INDENT>(_modelId, bestScore) =self._hsObj._resultsDB.bestModelIdAndErrScore(swarmId)<EOL><DEDENT>fieldScores.append((bestScore, field))<EOL><DEDENT>if self._hsObj._searchType == HsSearchType.legacyTemporal:<EOL><INDENT>assert(len(fieldScores)==<NUM_LIT:1>)<EOL>(baseErrScore, baseField) = fieldScores[<NUM_LIT:0>]<EOL>for swarmId, info in self._state['<STR_LIT>'].items():<EOL><INDENT>encodersUsed = swarmId.split('<STR_LIT:.>')<EOL>if len(encodersUsed) != <NUM_LIT:2>:<EOL><INDENT>continue<EOL><DEDENT>fields = [self.getEncoderNameFromKey(name) for name in encodersUsed]<EOL>fields.remove(baseField)<EOL>fieldScores.append((info['<STR_LIT>'], fields[<NUM_LIT:0>]))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>fieldScores.sort(reverse=True)<EOL>if self._hsObj._maxBranching > <NUM_LIT:0>and len(fieldScores) > self._hsObj._maxBranching:<EOL><INDENT>baseErrScore = fieldScores[-self._hsObj._maxBranching-<NUM_LIT:1>][<NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>baseErrScore = fieldScores[<NUM_LIT:0>][<NUM_LIT:0>]<EOL><DEDENT><DEDENT>pctFieldContributionsDict = dict()<EOL>absFieldContributionsDict = dict()<EOL>if baseErrScore is not None:<EOL><INDENT>if abs(baseErrScore) < <NUM_LIT>:<EOL><INDENT>baseErrScore = <NUM_LIT><EOL><DEDENT>for (errScore, field) in fieldScores:<EOL><INDENT>if errScore is not None:<EOL><INDENT>pctBetter = (baseErrScore - errScore) * <NUM_LIT> / baseErrScore<EOL><DEDENT>else:<EOL><INDENT>pctBetter = <NUM_LIT:0.0><EOL>errScore = baseErrScore   <EOL><DEDENT>pctFieldContributionsDict[field] = pctBetter<EOL>absFieldContributionsDict[field] = baseErrScore - errScore<EOL><DEDENT><DEDENT>self.logger.debug("<STR_LIT>" % (pctFieldContributionsDict))<EOL>return pctFieldContributionsDict, absFieldContributionsDict<EOL>
Return the field contributions statistics.

        Parameters:
        ---------------------------------------------------------------------
        retval:   Dictionary where the keys are the field names and the values
                    are how much each field contributed to the best score.