def addLabel(self, start, end, labelName):
if len(self._recordsCache) == <NUM_LIT:0>:<EOL><INDENT>raise HTMPredictionModelInvalidRangeError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>try:<EOL><INDENT>start = int(start)<EOL><DEDENT>except Exception:<EOL><INDENT>start = <NUM_LIT:0><EOL><DEDENT>try:<EOL><INDENT>end = int(end)<EOL><DEDENT>except Exception:<EOL><INDENT>end = int(self._recordsCache[-<NUM_LIT:1>].ROWID)<EOL><DEDENT>startID = self._recordsCache[<NUM_LIT:0>].ROWID<EOL>clippedStart = max(<NUM_LIT:0>, start - startID)<EOL>clippedEnd = max(<NUM_LIT:0>, min( len( self._recordsCache) , end - startID))<EOL>if clippedEnd <= clippedStart:<EOL><INDENT>raise HTMPredictionModelInvalidRangeError("<STR_LIT>",<EOL>debugInfo={<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': start,<EOL>'<STR_LIT>': end<EOL>},<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': clippedStart,<EOL>'<STR_LIT>': clippedEnd<EOL>},<EOL>'<STR_LIT>': {<EOL>'<STR_LIT>': startID,<EOL>'<STR_LIT>': self._recordsCache[len(self._recordsCache)-<NUM_LIT:1>].ROWID<EOL>},<EOL>'<STR_LIT>': len(self._recordsCache)<EOL>})<EOL><DEDENT>for state in self._recordsCache[clippedStart:clippedEnd]:<EOL><INDENT>if labelName not in state.anomalyLabel:<EOL><INDENT>state.anomalyLabel.append(labelName)<EOL>state.setByUser = True<EOL>self._addRecordToKNN(state)<EOL><DEDENT><DEDENT>assert len(self.saved_categories) > <NUM_LIT:0><EOL>for state in self._recordsCache[clippedEnd:]:<EOL><INDENT>self._classifyState(state)<EOL><DEDENT>
Add the label labelName to each record with record ROWID in range from
``start`` to ``end``, noninclusive of end.

This will recalculate all points from end to the last record stored in the
internal cache of this classifier.

:param start: (int) start index 
:param end: (int) end index (noninclusive)
:param labelName: (string) label name