Message Boards Message Boards

0
|
5221 Views
|
1 Reply
|
0 Total Likes
View groups...
Share
Share this post:

How to define k in kNN, NearestNeighbors

Posted 9 years ago

Hi,

I defined a NearestNeighbors classifier, but it defaults to 2 neighbors. I'm sure there is an obvious way to change the number of neighbors (k) but I don't seem to find it. Any help would be appreciated,

best, Marc

POSTED BY: marc meesens
Posted 9 years ago

OK, just found it,

c = Classify[trainingset, Method->{"NearestNeighbors", "NeighborsNumber"->1}]

cheers, marc

POSTED BY: marc meesens
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract