From ffd1457037a52cb63a7be0cf004e886f3909f505 Mon Sep 17 00:00:00 2001 From: Scott Purdy Date: Tue, 9 Jan 2018 17:07:57 -0800 Subject: [PATCH] Update KNN classifier documentation to make the input pattern requirements clear in both learn and infer --- src/nupic/algorithms/knn_classifier.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/nupic/algorithms/knn_classifier.py b/src/nupic/algorithms/knn_classifier.py index 3929e1cce4..c5fc714913 100755 --- a/src/nupic/algorithms/knn_classifier.py +++ b/src/nupic/algorithms/knn_classifier.py @@ -422,9 +422,9 @@ def learn(self, inputPattern, inputCategory, partitionId=None, isSparse=0, within distThreshold, only the first partitionId will be stored). This is an optional parameter. - :param isSparse: (int) If 0, the input pattern is a dense representation. If - isSparse > 0, the input pattern is a list of non-zero indices and - isSparse is the length of the dense representation + :param isSparse: (int) If 0, the input pattern is a dense representation. + If isSparse > 0, the input pattern is a list of non-zero indices of + the active bits and isSparse is the number of total bits (n). :param rowID: (int) UNKNOWN @@ -659,7 +659,8 @@ def infer(self, inputPattern, computeScores=True, overCategories=True, """Finds the category that best matches the input pattern. Returns the winning category index as well as a distribution over all categories. - :param inputPattern: (list) A pattern to be classified + :param inputPattern: (list or array) The pattern to be classified. This + must be a dense array. :param computeScores: NO EFFECT