Permalink
Browse files

Merge pull request #3791 from scottpurdy/master

Update KNN classifier documentation to make the input pattern require…
  • Loading branch information...
scottpurdy committed Jan 11, 2018
2 parents 5ecae91 + 38c9c7e commit 17db9048bde692891ce568a66e455ab2733b617c
Showing with 9 additions and 4 deletions.
  1. +9 −4 src/nupic/algorithms/knn_classifier.py
@@ -422,9 +422,13 @@ 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) 0 if the input pattern is a dense representation.
When the input pattern is a list of non-zero indices, then isSparse
is the number of total bits (n). E.g. for the dense array
[0, 1, 1, 0, 0, 1], isSparse should be `0`. For the equivalent sparse
representation [1, 2, 5] (which specifies the indices of active bits),
isSparse should be `6`, which is the total number of bits in the input
space.
:param rowID: (int) UNKNOWN
@@ -659,7 +663,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 representation of the array (e.g. [0, 0, 1, 1, 0, 1]).
:param computeScores: NO EFFECT

0 comments on commit 17db904

Please sign in to comment.