Tdnet - a Generative Model for Taxi Demand Prediction –

Tdnet - a Generative Model for Taxi Demand Prediction –

Linköping University | Department of Computer and Information Science Master thesis, 30 ECTS | Datateknik 2019 | LIU-IDA/LITH-EX-A--19/046--SE TDNet - A Generative Model for Taxi Demand Prediction – TDNet - En Generativ Modell för att Prediktera Taxiefterfrågan Gustav Svensk Supervisor : Suejb Memeti Examiner : Kristian Sandahl External supervisor : Eero Piitulainen Linköpings universitet SE–581 83 Linköping +46 13 28 10 00 , www.liu.se Upphovsrätt Detta dokument hålls tillgängligt på Internet - eller dess framtida ersättare - under 25 år från publicer- ingsdatum under förutsättning att inga extraordinära omständigheter uppstår. Tillgång till dokumentet innebär tillstånd för var och en att läsa, ladda ner, skriva ut enstaka ko- pior för enskilt bruk och att använda det oförändrat för ickekommersiell forskning och för undervis- ning. Överföring av upphovsrätten vid en senare tidpunkt kan inte upphäva detta tillstånd. All annan användning av dokumentet kräver upphovsmannens medgivande. För att garantera äktheten, säker- heten och tillgängligheten finns lösningar av teknisk och administrativ art. Upphovsmannens ideella rätt innefattar rätt att bli nämnd som upphovsman i den omfattning som god sed kräver vid användning av dokumentet på ovan beskrivna sätt samt skydd mot att dokumentet ändras eller presenteras i sådan form eller i sådant sammanhang som är kränkande för upphovsman- nens litterära eller konstnärliga anseende eller egenart. För ytterligare information om Linköping University Electronic Press se förlagets hemsida http://www.ep.liu.se/. Copyright The publishers will keep this document online on the Internet - or its possible replacement - for a period of 25 years starting from the date of publication barring exceptional circumstances. The online availability of the document implies permanent permission for anyone to read, to down- load, or to print out single copies for his/hers own use and to use it unchanged for non-commercial research and educational purpose. Subsequent transfers of copyright cannot revoke this permission. All other uses of the document are conditional upon the consent of the copyright owner. The publisher has taken technical and administrative measures to assure authenticity, security and accessibility. According to intellectual property law the author has the right to be mentioned when his/her work is accessed as described above and to be protected against infringement. For additional information about the Linköping University Electronic Press and its procedures for publication and for assurance of document integrity, please refer to its www home page: http://www.ep.liu.se/. © Gustav Svensk Abstract Supplying the right amount of taxis in the right place at the right time is very important for taxi companies. In this paper, the machine learning model Taxi Demand Net (TDNet) is presented which predicts short-term taxi demand in different zones of a city. It is based on WaveNet which is a causal dilated convolutional neural net for time-series generation. TDNet uses historical demand from the last years and transforms features such as time of day, day of week and day of month into 26-hour taxi demand forecasts for all zones in a city. It has been applied to one city in northern Europe and one in South America. In north- ern europe, an error of one taxi or less per hour per zone was achieved in 64% of the cases, in South America the number was 40%. In both cities, it beat the SARIMA and stacked ensemble benchmarks. This performance has been achieved by tuning the hyperparame- ters with a Bayesian optimization algorithm. Additionally, weather and holiday features were added as input features in the northern European city and they did not improve the accuracy of TDNet. Abstract Att ha rätt antal taxis på rätt plats vid rätt tid är väldigt viktigt för taxiföretag. I denna rapport presenteras maskininlärningsmodellen Taxi Demand Net (TDNet) som förutspår den kortfristiga efterfrågan på taxi i olika stadszoner med precision. Den är baserad på WaveNet, ett faltande neuralt nätverk med kausala och utvidgade lager för tidsseriepredik- tion. TDNet använder historisk efterfrågan från de senaste åren och transformerar infor- mation så som tid på dygnet, dag i veckan och dag i månad till prognoser för efterfrågan på taxi som sträcker sig 26 timmar framåt för alla zoner i en stad. Modellen har tilläm- pats på en stad i norra Europa och en i Sydamerika, den har åstadkommit ett fel på en taxi eller mindre i 64% respektive 40% av fallen. I båda städer har den slagit referensmod- ellerna SARIMA samt en viktad ensemble. Denna precision har nåtts genom att hitta hy- perparamtetrar med en bayesiansk optimeringsmetod. Dessutom har det visats att varken information om väder eller helgdagar förbättrar modellens prestanda. Acknowledgments I would like to thank my supervisors Suejb Memeti at the university and Eero Piitulainen at Taxicaller for providing valuable input and supporting me during this semester. I would also like to thank my examiner Kristian Sandahl for answering questions and taking on my thesis. Lastly I would like to thank everyone at Taxicaller for making me feel welcome. v Contents Abstract iii Sammanfattning iii Acknowledgments v Contents vi List of Figures viii List of Tables ix 1 Introduction 1 1.1 Motivation . 1 1.2 Aim............................................ 2 1.3 Research questions . 2 1.4 Delimitations . 3 2 Theory 4 2.1 Taxi Demand . 4 2.2 Contextualizing Machine Learning . 5 2.3 Basics of Supervised Learning . 6 2.4 Artificial Neural Networks . 8 2.5 Training a Network . 10 2.6 Convolutional Neural Networks . 11 2.7 RNN and Sequence to Sequence Models . 13 2.8 WaveNet . 13 2.9 Evaluation Metric . 14 2.10 Hyperparameter Tuning . 15 2.11 Sequential Model-based Optimization . 16 2.12 Tree Parzen Estimator . 17 2.13 SARIMA . 17 2.14 Stacked ensembles . 18 2.15 Mixed Precision . 18 2.16 Method . 18 3 Literature Review 19 3.1 WaveNet Architectures . 19 3.2 Alternative approaches . 20 3.3 Taxi Demand . 20 4 Method 22 4.1 Data Description . 22 vi 4.2 Data Cleaning . 23 4.3 Data Splitting . 23 4.4 Data Preprocessing . 23 4.5 Data Exploration . 24 4.6 Model Implementation . 27 4.7 Hyperparameter Tuning . 27 4.8 Evaluation . 29 4.9 Benchmarks . 30 4.10 Feature Importance . 30 4.11 Rounding . 30 4.12 Models trained . 31 5 Empirical Evaluation 32 5.1 Experimental Setup . 32 5.2 Results NE . 33 5.3 Results SA . 39 5.4 Hyperparameters and Architecture . 42 6 Discussion 43 6.1 Results NE . 43 6.2 Results SA . 45 6.3 Comparing the Cities . 45 6.4 Method Criticism . 46 6.5 Comparing the Models . 48 6.6 Comparing TDNet to the Literature . 49 6.7 Improving TDNet . 50 6.8 The work in a wider context . 51 7 Conclusion 53 7.1 Connection to Research Questions . 53 7.2 Future Research . 54 Bibliography 55 Glossary 59 vii List of Figures 2.1 Taxi Demand Example . 5 2.2 Example problem, supervised learning . 6 2.3 Polynomial Curves . 7 2.4 Error plot polynomial curves . 8 2.5 Activation Functions . 9 2.6 Neural Network . 10 2.7 Convolving an image . 12 2.8 A Stack of dilated causal convolutional layers . 14 2.9 MNIST images . 16 4.1 True Demand per Hour in SA . 25 4.2 True Demand per Hour in NE . 25 4.3 Zone Demand Distribution in SA . 26 4.4 Zone Demand Distribution in NE . 26 4.5 Building block of TDNet architecture . 28 5.1 Result NE . 34 5.2 Error Distribution of RMSLE in NE . 34 5.3 Error Distribution of RMSLE in NE of Non-zero Demand . 35 5.4 Error Distribution of RMSE in NE . 35 5.5 Zone Error Distribution NE . 36 5.6 Total Demand in NE over Test Period . 37 5.7 Total Demand Benchmarks NE . 37 5.8 Prediction Error per Hour NE . 38 5.9 Train loss . ..

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    68 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us