Git Product home page Git Product logo

trajectory_classification's Introduction

Trajectory-classification

Python code to re-produce results and illustrations of trajectory classification detailed in publications [1] and [2] :

Dataset

Two datasets are used in the publication :

  • Caltrain dataset is composed of 4127 trajectories from taxis which begin their trip at Caltrain station, San Francisco. It is a subset of the cabspotting data set [3]. To generate this subset, download cabspotting file [3], move it into data folder and run generate_caltrain_data.py script.

caltrain dataset

  • Sao Bento dataset is composed of 19423 trajectories from taxis which begin their trip at Sao Bento station, Porto. It is a subset of train dataset of the Kaggle ECML/PKDD 15: Taxi Trajectory Prediction (I) competition [3]. To generate this subset, download train.csv file [4], move it into data folder and run generate_saobento_data.py script.

sao bento dataset

Trajectory clustering

  1. compute_distance_matrix.py: SSPD distance [1] are computed between trajectories of each dataset, using trajectory_distance package [5].
  2. trajectory_clustering.py: Hierarchical clustering is then perfomed on the distance matrices.
  3. generate_figure.py: Produce the following png file.

Caltrain classification

Sao Bento classification

Trajectory Classification

  1. generate_mm_cv.py: A 10-fold cross validation procedure to evaluate performance of the model describes in [2] and produce the following result :
 Caltrain Dataset
Percentage of well classified trajectory for Caltrain dataset : 90.89
Percentage of of trajectories where good prediction are within best-3 predictions: 98.45
SaoBento Dataset
Percentage of well classified trajectory : 92.95
Percentage of of trajectories where good prediction are within best-3 predictions: 99.35

2/ generate_roc_curve.py : Produce the following roc curve from cross validation procedure.

Caltrain Roc curves

Sao Bento Roc curves

Dependencies

  • Python = 2.7.14
  • pandas = 0.22.0
  • numpy = 1.13.3
  • traj_dist = 1.0
  • matplotlib = 2.1.0
  • basemap = 1.0.7
  • fastcluster = 1.1.24
  • scipy = 1.0.0

References

trajectory_classification's People

Contributors

bguillouet avatar

Watchers

James Cloos avatar SSS avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.