Skip to main content

Implementation of Traclus for 2-D trajectories

Project description

# traclus_impl

### Purpose This is a Python implementation of the Traclus algorithm. It works for 2-D trajectories. Note that this was written as a piece of a senior project. This traclus implementation should functionally work, but it is currently slow on larger sets of trajectories.

### Install The easiest way to install is with pip install traclus_impl.

### Usage To run the Traclus algorithm, run, passing it the name of an input file and output file. The input file contains a json object with parameters to traclus and the raw trajectories. See “traclus_impl.integ_tests.raw_campus_trajectories.txt” for an example input file. The output file will contain a json list of representative trajectories. Optionally, provide names of files to dump the output from the partitioning and clustering stages to.

Example: navigate to directory where is and run “python -i ./raw_traj_input -o ./traclus_output

Note that the actual entry point function of the real computation is “run_traclus” in The “run_traclus” function takes Traclus arguments and a list of trajectories. The list of trajectories input to “run_traclus” is a list of traclus_impl.geometry.Point objects, and it returns a list of representative line segments as this same type of object. only parses arguments to traclus, calls run_traclus, and writes them to a file. It is mostly just an example of a way to use the “run_traclus” function.

The best example of complete usage is the test in “”.

### Intermediate output hooks ### The “run_traclus” function in optionally takes hooks for the output of the partitioning stage and clustering stage. The hook functions for these in and the “” tests show some example usage.

### Running the tests. Tests exist under the traclus_impl.tests and traclus_impl.integ_tests. To run all of the tests from the commandline, navigate to the package’s root and run: python -m unittest discover -p “”

### Notes on Performance ### * Currently, the main bottleneck seems to be the quadratic clustering, and future work includes improving this. For some larger trajectory sets such as the elk file under integ_tests/deer_tests, this implementation will take a very long time. * is mostly used for profiling this traclus implementation on the trajectories in that folder.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for traclus_impl, version 0.9.5
Filename, size File type Python version Upload date Hashes
Filename, size (478.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page