From 1225b3771411cda0cc2d07688f3340ab840433ec Mon Sep 17 00:00:00 2001 From: Pierre Alexandre Tremblay Date: Wed, 4 Dec 2019 13:39:07 +0000 Subject: [PATCH] corrected KNN methods to match Max's naming --- release-packaging/Classes/FluidKNN.sc | 4 ++-- release-packaging/HelpSource/Classes/FluidKNN.schelp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/release-packaging/Classes/FluidKNN.sc b/release-packaging/Classes/FluidKNN.sc index 21a598f..f2e523b 100644 --- a/release-packaging/Classes/FluidKNN.sc +++ b/release-packaging/Classes/FluidKNN.sc @@ -4,11 +4,11 @@ FluidKNN : FluidManipulationClient { this.pr_sendMsg(\fit,[dataset.asString],action); } - classify{ |buffer, labelset, k, action| + classifyPoint{ |buffer, labelset, k, action| this.pr_sendMsg(\classify,[buffer.asUGenInput, labelset.asString, k],action,k.collect{string(FluidMessageResponse,_,_)}); } - regress { |buffer,dataset, k, action| + regressPoint { |buffer,dataset, k, action| this.pr_sendMsg(\regress,[buffer.asUGenInput, dataset.asString,k],action,[number(FluidMessageResponse,_,_)]); } diff --git a/release-packaging/HelpSource/Classes/FluidKNN.schelp b/release-packaging/HelpSource/Classes/FluidKNN.schelp index 1366650..41abca3 100644 --- a/release-packaging/HelpSource/Classes/FluidKNN.schelp +++ b/release-packaging/HelpSource/Classes/FluidKNN.schelp @@ -25,7 +25,7 @@ source link::Classes/FluidDataSet:: ARGUMENT:: action A function to run when fitting is complete -METHOD:: regress +METHOD:: regressPoint Map a point between a source link::Classes/FluidDataSet:: used when link::Classes/FluidKNN#index::ing this KNN, and a target data set passed as an argument. For this to work, the target data set must have labels in common with the source data set. The code::k:: nearest neighbours to the supplied data point are retrrived from the source tree, and then a mapping is obtained through the average of the equivalently labelled points in the target data set. @@ -44,7 +44,7 @@ The number of neighbours to use in the estimation ARGUMENT:: action A function to run when the server responds, taking the value of the regressed point as its argument -METHOD:: classify +METHOD:: classifyPoint Classify a point, using categories from the supplied label set, which maps labels from the source data set to category IDs. This works by getting the labels of the code::k:: nearest points to the passed data point from the source data set, and looking up their IDs in the passed label set. The most frequently ocurring ID is designated as the class for the point. ARGUMENT:: buffer