diff --git a/release-packaging/Classes/FluidUMAP.sc b/release-packaging/Classes/FluidUMAP.sc index bf4f252..48a9cbb 100644 --- a/release-packaging/Classes/FluidUMAP.sc +++ b/release-packaging/Classes/FluidUMAP.sc @@ -48,6 +48,20 @@ FluidUMAP : FluidModelObject { this.prSendMsg(this.transformMsg(sourceDataSet,destDataSet)); } + + transformPointMsg{|sourceBuffer, destBuffer| + ^this.prMakeMsg(\transformPoint,id, + this.prEncodeBuffer(sourceBuffer), + this.prEncodeBuffer(destBuffer), + ["/b_query",destBuffer.asUGenInput] + ); + } + + transformPoint{|sourceBuffer, destBuffer, action| + actions[\transformPoint] = [nil,{action.value(destBuffer)}]; + this.prSendMsg(this.transformPointMsg(sourceBuffer,destBuffer)); + } + // not implemented cols {|action|} size { |action|} diff --git a/release-packaging/HelpSource/Classes/FluidUMAP.schelp b/release-packaging/HelpSource/Classes/FluidUMAP.schelp index a756ca9..699bf22 100644 --- a/release-packaging/HelpSource/Classes/FluidUMAP.schelp +++ b/release-packaging/HelpSource/Classes/FluidUMAP.schelp @@ -209,6 +209,23 @@ w.front; //this is because the fitTransform method has the advantage of being certain that the data it transforms is the one that has been used to fit the model. This allows for more accurate distance measurement. +//to check, let's retrieve a single point and predict its position +( +~sourcePoint = Buffer(s); +~original = Buffer(s); +~standed = Buffer(s); +~umaped = Buffer(s); +) + +//retrieve the 3D original +~raw.getPoint("entry50",~sourcePoint) +//retrieve the fitTransformed point as the most accurate point +~reduced.getPoint("entry50",~original, {~original.getn(0,2,{|x|x.postln})}) +//retreive the transformed point, via the standardizer +~standardizer.transformPoint(~sourcePoint,~standed); +~umap.transformPoint(~standed, ~umaped, {~umaped.getn(0,2,{|x|x.postln})}) + + //poking at the data structure within ~umap.dump{|x|x.keys.do{|i|"%: %\n".postf(i,x[i]);}}