Parameters:
gamma - the length-scale of the Gaussian (gamma in the paper)
noiseVar - the variance of the assumed noise (sigma squared in the paper)
diag - dependency of x and y (alpha in the paper)
kernelMix - the relative weight of the linear and non-linear parts of the kernel function ("a" in the paper)
Parameters:
touchData - 2D array, each row is one touch with intended target, with columns touch x and y, and target x and y
targetsAreOffsets - boolean, defaults to false; if true, the 3rd and 4th column of each row in the touchData array are interpreted as measured offsets directly, instead of target locations
Parameters:
inputs - 2D array, each row is one touch with columns x and y
returnVar - boolean, defaults to false; if false this method only returns the mean prediction for each touch; if true, the method also returns the predictive covariance matrix for each touch
Returns:
If returnVar is set to false, this method returns a 2D array: each row contains the x and y mean predictions for the touch in the corresponding row of the inputs array. If returnVar is set to true, this method returns two objects:
Parameters:
lambdaReg - the regularisation parameter
Parameters:
touchData - 2D array, each row is one touch with intended target, with columns touch x and y, and target x and y
targetsAreOffsets - boolean, defaults to false; if true, the 3rd and 4th column of each row in the touchData array are interpreted as measured offsets directly, instead of target locations
Parameters:
inputs - 2D array, each row is one touch with columns x and y
returnVar - boolean, defaults to false; if false this method only returns the mean prediction for each touch; if true, the method also returns the predictive covariance matrix for each touch
Returns:
If returnVar is set to false, this method returns a 2D array: each row contains the x and y mean predictions for the touch in the corresponding row of the inputs array. If returnVar is set to true, this method returns two objects:
Parameters:
lambdaReg - float, defaults to 0.001; the regularisation parameter
Parameters:
touchData - 2D array, each row is one touch with intended target, with columns touch x and y, and target x and y
targetsAreOffsets - boolean, defaults to false; if true, the 3rd and 4th column of each row in the touchData array are interpreted as measured offsets directly, instead of target locations
Parameters:
inputs - 2D array, each row is one touch with columns x and y
returnVar - boolean, defaults to false; if false this method only returns the mean prediction for each touch; if true, the method also returns the predictive covariance matrix for each touch
Returns:
If returnVar is set to false, this method returns a 2D array: each row contains the x and y mean predictions for the touch in the corresponding row of the inputs array. If returnVar is set to true, this method returns an object with two attributes:
Parameters:
gamma - float, defaults to 2; the length-scale of the Gaussian (gamma in the paper)
noiseVar - float, defaults to 0.001; the variance of the assumed noise (sigma squared in the paper)
kernelMix - float, defaults to 0.1; the relative weight of the linear and non-linear parts of the kernel function ("a" in the paper)
Note: In contrast to the Python version, this JavaScript implementation of the GP models uses diag fixed to zero for reasons of performance. This avoids doubling the size of the covariance matrix (see GP model description in the paper).
Parameters:
touchData - 2D array, each row is one touch with intended target, with columns touch x and y, and target x and y
targetsAreOffsets - boolean, defaults to false; if true, the 3rd and 4th column of each row in the touchData array are interpreted as measured offsets directly, instead of target locations
Parameters:
inputs - 2D array, each row is one touch with columns x and y
returnVar - boolean, defaults to false; if false this method only returns the mean prediction for each touch; if true, the method also returns the predictive covariance matrix for each touch
Returns:
If returnVar is set to false, this method returns a 2D array: each row contains the x and y mean predictions for the touch in the corresponding row of the inputs array. If returnVar is set to true, this method returns an object with two attributes:
Parameters:
file - the file (path) with the data
callback - function to be called after loading the data. The callback function should take one parameter, which is the data.
The usage of the Android part of the toolkit is equivalent to the others and is demonstrated in an example app (Android-Studio project), which showcases learning and predicting touch targeting behaviour.
To use the models in other Android projects right away, just copy over the "ml" package from the Android "src" directory to your own project - it contains all relevant files (GPOffsetModel.java, LinearOffsetModel.java, OffsetModel.java). This saves you the time to import a library, and you can easily edit the code as well, if you so desire.
Basic code snippets can be found on the Examples page.