def _classifyState(self, state):
<EOL>if state.ROWID < self.getParameter('<STR_LIT>'):<EOL><INDENT>if not state.setByUser:<EOL><INDENT>state.anomalyLabel = []<EOL>self._deleteRecordsFromKNN([state])<EOL><DEDENT>return<EOL><DEDENT>label = KNNAnomalyClassifierRegion.AUTO_THRESHOLD_CLASSIFIED_LABEL<EOL>autoLabel = label + KNNAnomalyClassifierRegion.AUTO_TAG<EOL>newCategory = self._recomputeRecordFromKNN(state)<EOL>labelList = self._categoryToLabelList(newCategory)<EOL>if state.setByUser:<EOL><INDENT>if label in state.anomalyLabel:<EOL><INDENT>state.anomalyLabel.remove(label)<EOL><DEDENT>if autoLabel in state.anomalyLabel:<EOL><INDENT>state.anomalyLabel.remove(autoLabel)<EOL><DEDENT>labelList.extend(state.anomalyLabel)<EOL><DEDENT>if state.anomalyScore >= self.getParameter('<STR_LIT>'):<EOL><INDENT>labelList.append(label)<EOL><DEDENT>elif label in labelList:<EOL><INDENT>ind = labelList.index(label)<EOL>labelList[ind] = autoLabel<EOL><DEDENT>labelList = list(set(labelList))<EOL>if label in labelList and autoLabel in labelList:<EOL><INDENT>labelList.remove(autoLabel)<EOL><DEDENT>if state.anomalyLabel == labelList:<EOL><INDENT>return<EOL><DEDENT>state.anomalyLabel = labelList<EOL>if state.anomalyLabel == []:<EOL><INDENT>self._deleteRecordsFromKNN([state])<EOL><DEDENT>else:<EOL><INDENT>self._addRecordToKNN(state)<EOL><DEDENT>
Reclassifies given state.