Hello everyone,
I have two sets of Origin and Destination locations (Longitude, Latitude + ID) for more than 6000 trips and I want to cluster them using GMM, based on their locations. In other words, trips with similar OD pairs will be in the same cluster.
I asked a friend to tell me how to have OD pairs presented as the input to the GMM algorithm and they gave me the below pseudocode that I cannot figure out. Can anyone help me figure out what to do to develop the code? I am not super proficient with python.
Or if there is any other way that you can help me to achieve my purpose, I'd appreciate it if you could share.
You'll need 2 sets, You're name of CSV file, And a hadhmap:
Map clusterOD(filename){
Arr = readCsv(filename) //array[n][2]
Originset
DesSet
Omean
DMean
// Floating mean
For I in range(sizeof(arr)){
N = 1
For j in range(I, sizeof(arr))
{
//Gets all means and adds to set
}
}
Map
//Permutati
Add to hadhmap
Sort and grav