Git Product home page Git Product logo

traclusalgorithm's Introduction

TraClus Algorithm

This is an implementation of TraClus (TRAjectory CLUStering) [1] algorithm in Java. A GUI was added for the convenience.

The original paper of this algorithm can be found at http://hanj.cs.illinois.edu/pdf/sigmod07_jglee.pdf The authors of the paper implemented the algorithm in C++, so it could be helpful to develop one in Java for other users to use. I have compared the output with the one generated by the C++ implementation, so far I have not found any bugs. It will be great if any one reports any bugs about this implementation.

I am currently involved in a maritime traffic project which requires me to implement various clustering algorithms. So that is the very first motivation about why I do this implementation. I also implemented another clustering algorithm called DBSCANSD which was proposed during my thesis study and you can find its code from the follwoing link: https://github.com/luborliu/DBSCANSD

How to run the code?

After downloading it to local,

  1. cd to the folder of src/boliu/

  2. compile all the .java files using:

    javac *.java

  3. cd to the folder of src/

  4. execute the program using the following either command:

    1. java boliu.Main inputfile outputfile

      --e.g. java boliu.Main deer_1995.tra testOut.txt

      In this way, the program will help you to decide the parameters for eps and minLns;

    2. java boliu.Main inputfile outputfile eps minLns

      --e.g. java boliu.Main deer_1995.tra testOut.txt 29 8

      In this way, you tell the program the parameters for eps and minLns, which are 29 and 8 separately.

  5. waiting for the result :)

  6. Star it if it helps *-*

Input file format

The data format is as follows:

1st line: Number of dimensions (2 for example)

2nd line: Number of trajectories (32 for example)

3rd line: Trajectory Index (starting from 0, so 0 for this line), Number of trajectory points in this trajectory (n for example), X1, Y1, X2, Y2, …., Xn, Yn

4th line: Trajectory Index (starting from 0, so 1 for this line), Number of trajectory points in this trajectory (m for example), X1, Y1, X2, Y2, …., Xm, Ym
.
.
.
34th line:Trajectory Index (starting from 0, so 31 for this line), Number of trajectory points in this trajectory (j for example), X1, Y1, X2, Y2, …., Xj, Yj

Reference

[1] Lee, Jae-Gil, Jiawei Han, and Kyu-Young Whang. "Trajectory clustering: a partition-and-group framework." Proceedings of the 2007 ACM SIGMOD international conference on Management of data. ACM, 2007.

Realse Note

02/23/2017 Create License file under MIT license as requested.

03/10/2016 Fix a bug (reported by @luca-zamboni) that will throw InputMismatchException while the code is downloaded in some countries.

02/02/2016 Fix a bug (reported by Dieter) of estimation function (cannot give right output according to different input files).

11/25/2015 Fix a bug (reported by @ankushdas) that makes the program not work for multi-dimensional (>2) data set.

traclusalgorithm's People

Contributors

luborliu avatar mettbrot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

traclusalgorithm's Issues

坐标数据的格式

hi,

问下测试数据中的坐标数据,是哪个坐标系的?
和经纬度坐标怎么转换?

thx

Not working with Lat/Lng

Hi,
when I give the algo positive lat/long values (city scale) it will not provide any results, I have to multiply the coordinates with 50000 to get some results that look right.
Do you know what must be changed?

The first lines of my Input file:
2
310
0 8 50.1140929 8.6814618 50.1146149 8.68167818 50.1150859 8.68149518 50.1148239 8.68145218 50.1150339 8.68096418 50.114249 8.68099918 50.1142019 8.68042518 50.1141889 8.6804918
1 6 50.1072279 8.68138318 50.1072279 8.68138318 50.1071439 8.68181818 50.1072029 8.68227318 50.1071169 8.68237118 50.1074459 8.68242318
2 19 50.1072799 8.6824218 50.1073869 8.68236318 50.1078019 8.68218918 50.1096359 8.68201618 50.1096359 8.68201618 50.1103239 8.6822118 50.1105649 8.68230718 50.1110849 8.68165218 50.1112619 8.68086418 50.1103349 8.68361618 50.1106389 8.68488318 50.110649 8.68487118 50.1105639 8.68497318 50.1106529 8.6848718 50.1106689 8.68485218 50.1102029 8.68497918 50.1132469 8.67887418 50.11359 8.67906818 50.1140899 8.68081418
3 10 50.1124399 8.67760118 50.1104349 8.68227318 50.1111129 8.68125918 50.1104969 8.68483218 50.1104349 8.68424218 50.1104039 8.68534718 50.1104859 8.68548618 50.1110159 8.68478918 50.1114359 8.68461718 50.1134519 8.67932818
...

regards
Lukas

Code not working with a different dimension

Hi,
I am trying the TraClusAlgorithm code on my data with dimension 4. After making a few bug fixes (where the default dimension of 2 was assumed), the code still doesn't work. Can you help me out with this?

java.util.InputMismatchException

Had this problem
Exception in thread "main" java.util.InputMismatchException
at java.util.Scanner.throwFor(Scanner.java:864)
at java.util.Scanner.next(Scanner.java:1485)
at java.util.Scanner.nextDouble(Scanner.java:2413)
at boliu.TraClusterDoc.onOpenDocument(TraClusterDoc.java:92)
at boliu.Main.main(Main.java:20)

To solve this Exception add after line 75 in file TraClusterDoc the following line of code:
sc.useLocale(Locale.US);

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.