How much the buffered window moves forward, in samples. By default 512 to be similar with all other FluCoMa objects, the EBU specifies other values as per the examples below.
How much the buffered window moves forward, in samples. By default 512 to be similar with all other FluCoMa objects, the EBU specifies other values as per the examples below.
ARGUMENT:: padding
Controls the zero-padding added to either end of the source buffer or segment. Possible values are 0 (no padding), 1 (default, half the window size), or 2 (window size - hop size). Padding ensures that all input samples are completely analysed: with no padding, the first analysis window starts at time 0, and the samples at either end will be tapered by the STFT windowing function. Mode 1 has the effect of centering the first sample in the analysis window and ensuring that the very start and end of the segment are accounted for in the analysis. Mode 2 can be useful when the overlap factor (window size / hop size) is greater than 2, to ensure that the input samples at either end of the segment are covered by the same number of analysis frames as the rest of the analysed material.
ARGUMENT:: freeWhenDone
ARGUMENT:: freeWhenDone
Free the server instance when processing complete. Default true
Free the server instance when processing complete. Default true
@ -77,7 +77,16 @@ The link::Classes/FluidLabelSet:: from which to retrieve the point's IDs associa
ARGUMENT:: action
ARGUMENT:: action
A function to run when the import is done.
A function to run when the import is done.
METHOD:: getIds
Export to the dataset IDs to a link::Classes/FluidLabelSet::.
ARGUMENT:: labelSet
The link::Classes/FluidLabelSet:: to export to. Its content will be replaced.
ARGUMENT:: action
A function to run when the export is done.
METHOD:: merge
METHOD:: merge
Merge sourceDataSet in the current DataSet. It will update the value of points with the same label if overwrite is set to 1. To add columns instead, see the 'transformJoin' method of link::Classes/FluidDataSetQuery::
Merge sourceDataSet in the current DataSet. It will update the value of points with the same label if overwrite is set to 1. To add columns instead, see the 'transformJoin' method of link::Classes/FluidDataSetQuery::
Identify code::k:: clusters in a link::Classes/FluidDataSet::
Identify code::numClusters:: clusters in a link::Classes/FluidDataSet::. It will optimise until no improvement is possible, or up to code::maxIter::, whichever comes first. Subsequent calls will continue training from the stopping point with the same conditions.
ARGUMENT:: dataSet
ARGUMENT:: dataSet
A link::Classes/FluidDataSet:: of data points.
A link::Classes/FluidDataSet:: of data points.
ARGUMENT:: action
ARGUMENT:: action
A function to run when fitting is complete, taking as its argument an array with the number of data points for each cluster.
A function to run when fitting is complete, taking as its argument an array with the number of data points for each cluster.
METHOD:: predict
METHOD:: predict
Given a trained object, return the cluster ID for each data point in a DataSet to a label set.
Given a trained object, return the cluster ID for each data point in a link::Classes/FluidDataSet:: to a link::Classes/FluidLabelSet::.
ARGUMENT:: dataSet
ARGUMENT:: dataSet
a link::Classes/FluidDataSet:: containing the data to predict.
A link::Classes/FluidDataSet:: containing the data to predict.
ARGUMENT:: labelSet
ARGUMENT:: labelSet
a link::Classes/FluidLabelSet:: to retrieve the predicted clusters.
A link::Classes/FluidLabelSet:: to retrieve the predicted clusters.
ARGUMENT:: action
ARGUMENT:: action
A function to run when the server responds.
A function to run when the server responds.
@ -52,59 +52,55 @@ A function to run when the server responds
METHOD:: predictPoint
METHOD:: predictPoint
Given a trained object, return the cluster ID for a data point in a link::Classes/Buffer::
Given a trained object, return the cluster ID for a data point in a link::Classes/Buffer::
ARGUMENT:: buffer
ARGUMENT:: buffer
a link::Classes/Buffer:: containing a data point.
A link::Classes/Buffer:: containing a data point.
ARGUMENT:: action
ARGUMENT:: action
A function to run when the server responds, taking the ID of the cluster as its argument.
A function to run when the server responds, taking the ID of the cluster as its argument.
METHOD:: predict
METHOD:: transform
Report cluster assignments for previously unseen data.
Given a trained object, return for each item of a provided link::Classes/FluidDataSet:: its distance to each cluster as an array, often reffered to as the cluster-distance space.
ARGUMENT:: dataSet
ARGUMENT:: srcDataSet
A link::Classes/FluidDataSet:: of data points.
A link::Classes/FluidDataSet:: of data points to transform.
ARGUMENT:: labelSet
ARGUMENT:: dstDataSet
A link::Classes/FluidLabelSet:: to contain assignments.
A link::Classes/FluidDataSet:: to contain the new cluster-distance space.
ARGUMENT:: action
ARGUMENT:: action
A function to run when complete, taking an array of the counts for each category as its argument.
A function to run when complete.
METHOD:: fitTransform
METHOD:: fitTransform
Run link::Classes/FluidKMeans#*fit:: and link::Classes/FluidKMeans#*predict:: in a single pass: i.e. train the model on the incoming link::Classes/FluidDataSet:: and then return the learned clustering to the passed link::Classes/FluidLabelSet::
Run link::Classes/FluidKMeans#*fit:: and link::Classes/FluidKMeans#*transform:: in a single pass: i.e. train the model on the incoming link::Classes/FluidDataSet:: and then return its cluster-distance space in the destination link::Classes/FluidDataSet::
ARGUMENT:: srcDataSet
ARGUMENT:: srcDataSet
a link::Classes/FluidDataSet:: containing the data to fit and predict.
A link::Classes/FluidDataSet:: containing the data to fit and transform.
ARGUMENT:: dstDataSet
ARGUMENT:: dstDataSet
a link::Classes/FluidLabelSet:: to retrieve the predicted clusters.
A link::Classes/FluidDataSet:: to contain the new cluster-distance space.
ARGUMENT:: action
ARGUMENT:: action
A function to run when the server responds
A function to run when complete.
METHOD:: transformPoint
METHOD:: transformPoint
Given a trained object, return the cluster ID for a data point in a link::Classes/Buffer::
Given a trained object, return the distance of the provided point to each cluster. Both points are handled as link::Classes/Buffer::
ARGUMENT:: sourceBuffer
ARGUMENT:: sourceBuffer
a link::Classes/Buffer:: containing a data point.
A link::Classes/Buffer:: containing a data point to query.
ARGUMENT:: targetBuffer
ARGUMENT:: targetBuffer
a link::Classes/Buffer:: containing a data point.
A link::Classes/Buffer:: containing a the distance of the source point to each cluster.
ARGUMENT:: action
A function to run when the server responds, taking the ID of the cluster as its argument.
METHOD:: transform
Report cluster assignments for previously unseen data.
ARGUMENT:: srcDataSet
A link::Classes/FluidDataSet:: of data points.
ARGUMENT:: dstDataSet
A link::Classes/FluidLabelSet:: to contain assignments.
ARGUMENT:: action
ARGUMENT:: action
A function to run when complete, taking an array of the counts for each category as its argument.
A function to run when complete.
METHOD:: getMeans
METHOD:: getMeans
Report cluster assignments for previously unseen data.
Given a trained object, retrieve the means (centroids) of each cluster as a link::Classes/FluidDataSet::
ARGUMENT:: dataSet
ARGUMENT:: dataSet
A link::Classes/FluidDataSet:: of data points.
A link::Classes/FluidDataSet:: of clusers with a mean per column.
ARGUMENT:: action
ARGUMENT:: action
A function to run when complete, taking an array of the counts for each category as its argument.
A function to run when complete.
METHOD:: setMeans
METHOD:: setMeans
Report cluster assignments for previously unseen data.
Overwrites the means (centroids) of each cluster, and declare the object trained.
ARGUMENT:: dataSet
ARGUMENT:: dataSet
A link::Classes/FluidDataSet:: of data points.
A link::Classes/FluidDataSet:: of clusers with a mean per column.
ARGUMENT:: action
A function to run when complete.
METHOD:: clear
Reset the object status to not fitted and untrained.
ARGUMENT:: action
ARGUMENT:: action
A function to run when complete, taking an array of the counts for each category as its argument.
A function to run when complete.
EXAMPLES::
EXAMPLES::
code::
code::
@ -192,30 +188,40 @@ subsection:: Accessing the means
We can get and set the means for each cluster, their centroid.
We can get and set the means for each cluster, their centroid.
code::
code::
// with the dataset and kmeans generated and trained in the code above
~centroids = FluidDataSet(s);
~centroids = FluidDataSet(s);
~kmeans.getMeans(~centroids, {~centroids.print});
~kmeans.getMeans(~centroids, {~centroids.print});
// We can also set them to arbitrary values to seed the process
//subtle in this case but still.. each quadrant is where we seeded it.
::
::
subsection:: Cluster-distance Space
subsection:: Cluster-distance Space
You can get the euclidian distance of a given point to each cluster.
We can get the euclidian distance of a given point to each cluster. This is often referred to as the cluster-distance space as it creates new dimensions for each given point, one distance per cluster.
code::
code::
// with the dataset and kmeans generated and trained in the code above
b = Buffer.sendCollection(s,[0.5,0.5])
b = Buffer.sendCollection(s,[0.5,0.5])
c = Buffer(s)
c = Buffer(s)
// get the distance of our given point (b) to each cluster, thus giving us 4 dimensions in our cluster-distance space