UMAP: transformPoint method def, and example in help file

nix
Pierre Alexandre Tremblay 5 years ago
parent 2eec5f7cd7
commit 82d6a2b355

@ -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|}

@ -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]);}}

Loading…
Cancel
Save