I have labeled GPS location data (lat,lon) for determining whether a trip is of a certain type. The location data consists of start and end points, in the format of lat,lon coordinates. A trip is labeled by bicycle or car, and this is what I'm trying to predict based on a persons previous location habits.

For example the coordinates (lat1,lon1) to (lat2,lon2) has previously always been traveled by car, whereas (lat1,lon1) to (lat3,lon3) is usually traveled by bicycle. Hour of day data is also available which I think also could be used to predict. The city in which coordinations are collected in is small, so distance would not be a good indicator of the trip type.

I have tried to feed the start location, end location and hour of day with the label into an NN, but without results. I guess this is because lon,lat coordinates are only useful as a pair and not as independent parameters?

(A4,B7) -> Bicycle

(A4,B8) -> Car

(B7,A4) -> Car

Will the network be able to detect patterns in the data? Or is a neural network a bad idea and should I instead go for an alternative approach?

  • $\begingroup$ Can you clarify on what you mean with without results? If test results are bad, there might be a pattern that goes undetected and therefore it may be useful to get some insights on where/when the predictive power is low. A sketch of your architecture would be also useful. $\endgroup$ – IcannotFixThis Aug 8 '17 at 9:39
  • $\begingroup$ As others have said, feeding in your two coordinates separately should be fine. If your results aren't satisfactory either there isn't a distinguishable pattern or you may need to change your hyperparameters $\endgroup$ – Frobot Aug 13 '17 at 23:34

Given sufficient width or depth (in practice depth), a neural network can learn to associate longitude/latitude pairs. it's not even very hard. That's not your problem. In fact, given the highly non-linear relation between the 4 coordinates, it makes much sense.

I'm not sure why you're using only a few bits of grid coordinates - looks like 3. That's quite low. This means most GPS errors are ignored, but those that aren't are immediately severe (whole grid block off). Other forms of clustering are similarly problematic.

From practical experience (came to work by bike this morning), the chief predictor is the weather. Rain = car.


Assuming that there is a pattern (that is, your hypothesis is reasonable), your problem seems like it is more suited for decision tree-based approaches. For example, "if lat1 is within these values and lon1 is within these other values, and if lat2 is within ... and lon2 is within ..., then with probability ... the trip is taken by car". This will also allow you to easily check if the decision trees are doing something reasonable. Usually, decision-tree based approaches perform better on structured data (at least, according to Kaggle competition results), whereas neural network-based approaches work better on unstructured data (audio, images etc.)

You can then end up using something more powerful, like Xgboost or Random Forests to improve the performance of your model.

As has been mentioned, it may be important to include weather conditions as one of your predictors.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.