Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Commit

Permalink
Include example to make isSparse parameter easier to understand
Browse files Browse the repository at this point in the history
  • Loading branch information
scottpurdy committed Jan 11, 2018
1 parent ffd1457 commit 94e5f62
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/nupic/algorithms/knn_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 of
the active bits and isSparse is the number of total bits (n).
: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
Expand Down

0 comments on commit 94e5f62

Please sign in to comment.