Description Usage Arguments Value Examples
k-Nearest Neighbour k-nearest neighbour classification/Regression for test set from training set. For each row of the test set, the k nearest (according to distance metric speicified) training set vectors are found, and the classification is decided by majority vote, with ties broken at random. If there are ties for the kth nearest vector, all candidates are included in the vote. If classify flag is false, average of k neighbours is returned.
1 2 |
train |
input deep FLTable |
test |
input deep FLTable |
cl |
ColumnName of true classifications of training set |
k |
number of neighbours considered. |
prob |
If this is true, the proportion of the votes for the winning class are returned as attribute prob. |
classify |
logical if classification/regression is solved |
metric |
distance metric to be used. euclidean, manhattan supported. |
FLVector of classifications of test set.
1 2 3 4 | FLdeepTbl <- FLTable(getTestTableName("ARknnDevSmall"),"obsid","varid","num_val")
FLknnOutput <- knn(FLdeepTbl,k=3,prob=TRUE)
FLknnOutput
attributes(FLknnOutput)$prob
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.