Skip to content

knn_anomaly_classifier_region_test.py #23

@chhenning

Description

@chhenning
................D:\nupic\src\python\python3\nupic\algorithms\knn_classifier.py:358: DeprecationWarning: using a non-integer array as obj in delete will result in an error in the future
  removalArray).tolist()
D:\nupic\src\python\python3\nupic\algorithms\knn_classifier.py:362: DeprecationWarning: using a non-integer array as obj in delete will result in an error in the future
  numpy.array(self._categoryRecencyList), removalArray).tolist()
.E.Fs
======================================================================
ERROR: testSetGetWaitRecordsRecalculate (__main__.KNNAnomalyClassifierRegionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python36\lib\unittest\mock.py", line 1179, in patched
    return func(*args, **keywargs)
  File "knn_anomaly_classifier_region_test.py", line 342, in testSetGetWaitRecordsRecalculate
    self.helper.compute(dict(), dict())
  File "D:\nupic\src\python\python3\nupic\regions\knn_anomaly_classifier_region.py", line 326, in compute
    self._classifyState(record)
  File "D:\nupic\src\python\python3\nupic\regions\knn_anomaly_classifier_region.py", line 370, in _classifyState
    newCategory = self._recomputeRecordFromKNN(state)
  File "D:\nupic\src\python\python3\nupic\regions\knn_anomaly_classifier_region.py", line 564, in _recomputeRecordFromKNN
    self._knnclassifier.compute(inputs, outputs)
  File "D:\nupic\src\python\python3\nupic\regions\knn_classifier_region.py", line 964, in compute
    self._knn.infer(inputVector, partitionId=partition)
  File "D:\nupic\src\python\python3\nupic\algorithms\knn_classifier.py", line 736, in infer
    self._categoryList, dist)
RuntimeError: Buffer access out of bounds.

======================================================================
FAIL: testUpdateState (__main__.KNNAnomalyClassifierRegionTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Python36\lib\unittest\mock.py", line 1179, in patched
    return func(*args, **keywargs)
  File "knn_anomaly_classifier_region_test.py", line 433, in testUpdateState
    [recordCopy["anomalyLabel"][0], toLabelList.return_value[0]])
AssertionError: Lists differ: ['Label 2', 'Label'] != ['Label', 'Label 2']

First differing element 0:
'Label 2'
'Label'

- ['Label 2', 'Label']
?        --

+ ['Label', 'Label 2']
?                 ++


----------------------------------------------------------------------
Ran 21 tests in 0.046s

FAILED (failures=1, errors=1, skipped=1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions