|
Teetool
Probabilistic modelling of trajectories
|
World class handles all trajectory data. More...
Public Member Functions | |
| def | __init__ (self, name="", ndim=3, resolution=[10) |
| initialise World More... | |
| def | clear (self) |
| clear previously stored calculations More... | |
| def | overview (self) |
| prints an overview (text) More... | |
| def | addCluster (self, cluster_data, cluster_name="") |
| add a cluster to the world More... | |
| def | getName (self) |
| returns the name of the world More... | |
| def | getCluster (self, list_icluster=None) |
| obtain cluster data More... | |
| def | getClusterPoints (self, x1, list_icluster=None) |
| obtain cluster data at specific points [0, 1] More... | |
| def | getTubeStats (self, list_icluster=None, sdwidth=1., resolution=None) |
| obtain statistics of confidence region in scenarios More... | |
| def | isInside (self, P, sdwidth=1, list_icluster=None) |
| def | getSamples (self, icluster, nsamples=50) |
| returns samples in a list of (x, Y) data More... | |
| def | buildModel (self, settings, list_icluster=None) |
| generates a model from the trajectory data More... | |
| def | getMean (self, list_icluster=None) |
| returns the mean trajectory [x, y, z] for list_icluster More... | |
| def | getTube (self, list_icluster=None, sdwidth=1, resolution=None, z=None) |
| returns a grid with bools to specify whether a point falls within the confidence region or not More... | |
| def | getLogLikelihood (self, list_icluster=None, resolution=None, z=None) |
| returns a grid with the maximum log-likelihood More... | |
Public Attributes | |
| fraction_to_expand | |
| fraction on edges, default 0.1 More... | |
Private Member Functions | |
| def | _check_icluster (self, icluster) |
| checks the validity of icluster More... | |
| def | _check_list_icluster (self, list_icluster) |
| checks the validity of a list of icluster More... | |
| def | _getGrid (self, outline, resolution=None) |
| returns a grid based on outline and resolution More... | |
| def | _get_outline_expanded (self, list_icluster=None, fraction_to_expand=0.1) |
| returns an expanded grid based on the outline of trajectory data in list_icluster More... | |
| def | _get_outline (self, list_icluster=None) |
| returns a grid based on the outline of trajectory data in list_icluster More... | |
| def | _get_outline_tube (self, sdwidth=1, list_icluster=None) |
| returns the outline of a tube of specified clusters More... | |
| def | _get_point_from_cluster_data (self, cluster_data, x1) |
| def | _get_point_from_xY (self, x, Y, x1) |
| returns the points nearest to x1 More... | |
Private Attributes | |
| _name | |
| name of world More... | |
| _ndim | |
| number of dimensions trajectory data More... | |
| _clusters | |
| list holding clusters More... | |
| _resolution | |
| resolution of grid More... | |
World class handles all trajectory data.
This class provides the direct interface to the trajectory data and produce models
| def teetool.world.World.__init__ | ( | self, | |
name = "", |
|||
ndim = 3, |
|||
resolution = [10 |
|||
| ) |
initialise World
| self | object pointer |
| name | world name, used in title and saving image |
| ndim | number of dimensions in trajectory data |
| resolution | specify resolution of grid |
|
private |
checks the validity of icluster
| self | object pointer |
| icluster | value to test |
|
private |
checks the validity of a list of icluster
| self | object pointer |
| list_icluster | list of icluster to test |
|
private |
returns a grid based on the outline of trajectory data in list_icluster
| self | object pointer |
| list_icluster | list of clusters to take into account |
returns the outline of specified clusters list_icluster is list of clusters, if None, show all
|
private |
returns an expanded grid based on the outline of trajectory data in list_icluster
| self | object pointer |
| list_icluster | list of clusters to take into account |
| fraction_to_expand | fraction to expand the outline with |
|
private |
returns the outline of a tube of specified clusters
| self | object pointer |
| sdwidth | variance to evaluate confidence region on |
| list_icluster | clusters to evaluate confidence on. None shows all |
|
private |
|
private |
returns the points nearest to x1
| self | object pointer |
| x | x from (x, Y), to find the relevant index |
| Y | Y from (x, Y), one of these values gets returned |
| x1 | timing [0, 1] to visualise points |
|
private |
returns a grid based on outline and resolution
| self | object pointer |
| outline | outline to generate grid from |
| resolution | resolution to generate grid from |
| def teetool.world.World.addCluster | ( | self, | |
| cluster_data, | |||
cluster_name = "" |
|||
| ) |
add a cluster to the world
| self | object pointer |
| cluster_data | list of (x, Y) trajectory data |
| cluster_name | name of added cluster |
| def teetool.world.World.buildModel | ( | self, | |
| settings, | |||
list_icluster = None |
|||
| ) |
generates a model from the trajectory data
| self | object pointer |
| settings | specify settings in dictionary model_type is resampling, ML, or EM ngaus is number of Gaussians |
| list_icluster |
| def teetool.world.World.clear | ( | self | ) |
clear previously stored calculations
| self | object pointer |
| def teetool.world.World.getCluster | ( | self, | |
list_icluster = None |
|||
| ) |
obtain cluster data
| self | object pointer |
| list_icluster | list of clusters to return |
| def teetool.world.World.getClusterPoints | ( | self, | |
| x1, | |||
list_icluster = None |
|||
| ) |
obtain cluster data at specific points [0, 1]
| self | object pointer |
| x1 | timing [0, 1] to visualise points |
| list_icluster | list of clusters to return |
| def teetool.world.World.getLogLikelihood | ( | self, | |
list_icluster = None, |
|||
resolution = None, |
|||
z = None |
|||
| ) |
returns a grid with the maximum log-likelihood
| self | object pointer |
| list_icluster | which clusters to return |
| resolution | the resolution to produce the grid on |
| z | (optional) height parameter to produce 2d grids for 3d trajectories |
| def teetool.world.World.getMean | ( | self, | |
list_icluster = None |
|||
| ) |
returns the mean trajectory [x, y, z] for list_icluster
| self | object pointer |
| list_icluster | specify clusters |
| def teetool.world.World.getName | ( | self | ) |
returns the name of the world
| self | object pointer |
| def teetool.world.World.getSamples | ( | self, | |
| icluster, | |||
nsamples = 50 |
|||
| ) |
returns samples in a list of (x, Y) data
| self | object pointer |
| icluster | specify from which cluster to sample |
| nsamples | number of samples to generate |
| def teetool.world.World.getTube | ( | self, | |
list_icluster = None, |
|||
sdwidth = 1, |
|||
resolution = None, |
|||
z = None |
|||
| ) |
returns a grid with bools to specify whether a point falls within the confidence region or not
| self | object pointer |
| list_icluster | which clusters to return |
| sdwidth | variance to test |
| resolution | the resolution to produce the grid on |
| z | (optional) height parameter to produce 2d grids for 3d trajectories |
| def teetool.world.World.getTubeStats | ( | self, | |
list_icluster = None, |
|||
sdwidth = 1., |
|||
resolution = None |
|||
| ) |
obtain statistics of confidence region in scenarios
| self | object pointer |
| list_icluster | list of clusters to analyse |
| sdwidth | variance to evaluate |
| resolution | resolution of grid |
| def teetool.world.World.isInside | ( | self, | |
| P, | |||
sdwidth = 1, |
|||
list_icluster = None |
|||
| ) |
returns list of bools, whether or not the points P are inside any of the models list_icluster can be set to limit the check to a single values
| def teetool.world.World.overview | ( | self | ) |
prints an overview (text)
| self | object pointer |
|
private |
list holding clusters
|
private |
name of world
|
private |
number of dimensions trajectory data
|
private |
resolution of grid
| teetool.world.World.fraction_to_expand |
fraction on edges, default 0.1
1.8.12