I have a dataset which contains 4000k rows and 6 columns. The goal is to predict travel time demand of a taxi. I have read many articles regarding how to approach the problem. So, every writer tell his own way. The thing which I have concluded from all my readings is that I have to use multiple algorithms and check the accuracy of each one. Then I can ensemble them by averaging or any other approach.

Which algorithms will be best for my problem accuracy-wise? Some links to code will be helpful for me.

I currently only have training set of data. After I work on it, it will be evaluated on any testing set by my professor. So, what should I do now? Either split data I have into my own testing and training set or separately generate dummy data as a testing set?


In general, this type of problem is called a regression problem since the target variable (i.e. travel time) can take any value in a continuous domain. In theory, you can use any regression algorithms (a subset supervised learning techniques) to solve this problem. Some of the most popular ones are linear regression, K-nearest neighbor (regressor), and neural networks.

As you observed already, different algorithms result in (sometimes significantly) different results. Also, the parameter configurations (e.g., number of hidden layers in Neural Networks) can make a big difference. Sometimes, ensembling different models can be helpful, but in general, you should try to avoid overfitting (when your model is more complex than your data such that it memorizes the training set instead of learning it!). That may result in a very good performance on your training set but perform very poorly on your professor's testing set.

What I would do is:

  • exploring the dataset to see what are the contributing factor in travel time (any correlation between the columns).
  • cleaning and preprocessing my dataset (duplicates, null values, outliers)
  • reshaping my dataset if needed (normalizing some columns, merging or splitting columns)
  • dividing my dataset to training and evaluation subsets (so I train on one part and test on the other part to avoid overfitting)
  • choosing a simple baseline, applying and measuring the accuracy metrics.
  • trying to fine tune parameters of my baseline or trying other more advanced techniques.
  • comparing the results and improving any part of the pipeline when necessary (more/less cleaning, parameter tuning, ensembling).
  • 2
    $\begingroup$ Yes. LR and ANNs do work on approximation functions and there are some other ML algorithms which use different approach to solve a problem, so, if someone doesn't want to get biased to a single approach then he can use others and then average the effects of all algorithms to get an unbiased result. Although, ML is not accurate enough still it is the only way to solve such problems because such problems don't follow a common pattern plus they don't purely follow some function. So, we have to go with both things to get an unbiased result. The approach is purely a data scientist's choice. $\endgroup$ – Saeed Ahmad Jun 14 at 11:13

The term forcasting is referencing to a blackbox which is feed with input data and prints out the estimated travel time of the taxi. A simplified equation would be:

$traveltime=distance(10km)*speed(20km/h)=0.5 hours$

Creating such an equation is more complicated if the number of input parameters is higher. If the prediction is made inside a computer game it's called a physics engine. The task is to convert the dataset with 4000k rows into a physics engine. Unfortunately, the AI Community doesn't has a standard algorithm for this problem. What neural networks are doing is to search in the dataset for a similar entry and then interpolate the data in-between which is equal to creating an average. Such a look-up table is different from a prediction.

In general there are two possible options for determine the traveltime. The first one is a query in the exciting dataset with neural networks. The second one is creating a forecasting model with an equation. Both can't be mixed, forecasting is different from a dataset lookup.

  • 2
    $\begingroup$ I'm afraid neural nets are not just "lookup tables". In fact, they can be used to approximate any function including what you proposed above. Please take a look here: en.wikipedia.org/wiki/Universal_approximation_theorem $\endgroup$ – Borhan Kazimipour Jun 14 at 7:36
  • 1
    $\begingroup$ Thanks for your answer. Actually, we are trying to solve transportation issues in the modern cities. We are developing this model to forecast travel time after which we will incorporate this to solve this issues of traffic in the long term. What approach do you suggest? I guess first one is better to use some algorithm. My question is what are the most appropriate algorithms for this. I have asked some Data Scientists in my circle, They suggested to use ARIMA, Linear Regression, LSTM some Boosting Algorithms. What is your opinion about it? $\endgroup$ – Saeed Ahmad Jun 14 at 7:37
  • 1
    $\begingroup$ I would say start with the most basic one, and gradually make your model more complex until you cannot achieve significantly better performance on your testing set. $\endgroup$ – Borhan Kazimipour Jun 14 at 7:56
  • $\begingroup$ If the aim is to proof that AI doesn't work, then the assumption make sense. We can indeed show that neural networks are universal function approximators, and that machine learning models can be improved gradually. But my interpretation of the OP was, that an engineering task has to be solved in which at the end a useful software is available. $\endgroup$ – Manuel Rodriguez Jun 15 at 11:30

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.