1.
Load data
Load N targeting actions from a csv-file with the four columns touch x, touch y, target x, target y:
2.
Train a model
Create a model object and call its fit method, providing the training data as a parameter:
3.
Visualise it
Visualise the model with one of the following plots:
1.
Create a model from data
Load targeting actions from a csv-file with the four columns touch x, touch y, target x, target y. Create an offset model and train it on the loaded data:
2.
Predict offsets of new touches
After training, offset predictions for N touch locations can be computed as follows:
As a result, means is a N x 2 array with the predicted x, y offsets, and covs is a list of N corresponding covariance matrices. Together, means and covs define a Gaussian distribution of likely offsets for each touch.
3.
Correct touch locations
Correct touch locations by adding the predicted mean offset per touch
Note: Thanks to numpy, arrays can be added up element-wise without loops.
1.
Create a model from external data
Create a model object and define a function to be called when the file is read. Finally, load targeting actions from a csv-file with the four columns touch x, touch y, target x, target y:
2.
Predict offsets
After training, offset predictions for N touch locations can be computed as follows:
As a result, pred is an object with two attributes:
Together, means and covs define a Gaussian distribution of likely offsets for each touch.
1.
Create a model from external data
Create a model object, and provide N training touches in a 2D-array (of shape N x 4) with the four columns touch x, touch y, target x, target y:
2.
Predict offsets
After training, offset predictions for a touch at location x, y are computed as follows:
As a result, mean and cov define a Gaussian distribution of likely offsets for this touch.