Git Product home page Git Product logo

trip-duration-prediction-using-nn's Introduction

Trip-duration-prediction-using-NN

This is a simple project to predict the approximate time during a taxi trip.

The input includes the latitude & longitude of the pick-up & drop-off sites and the pick-up time.

The output predicted time is in the form of '0-5min', '5-10min', '10-15min', '15-20min', '20-15min', '25-30min, '>30min'

How to run

To run this project, you can follow the steps below.

To run predictions using the pre-trained model:

The model parameters have be saved in model1_10epoch.h5 file.

I've set the input to be the original test data, so just python run.py .

Training the model from scratch

  • Download the New York City Taxi Trip Duration Dataset and store it in a directory dataset. Here I just used the train.zip as the whole training and testing dataset. Please change the datapath(the path for train.csv) in utils.py according to your path.
  • python train.py
  • python run.py

Data Preprocessing

These following features are extracted as inputs of the neural network

  • Distance features: 'distance_haversine', 'distance_dummy_manhattan'
  • Speed features:'avg_speed_h','avg_speed_m', unit:m/s
  • Time features: 'pick_up_h', 'pick_up_m', 'weekday', (0 represents Sunday)
  • Zone features: 'pickup_lat_label', 'pickup_long_label', 'dropoff_lat_label', 'dropoff_long_label'

Neural Network

A very simple Fully Connected Network with 3 Dense layers and 2 Dropout layers and SGD optimizer

trip-duration-prediction-using-nn's People

Contributors

elaineyao avatar

Stargazers

Eve_Bob_Alice avatar ChengpengLi avatar

Watchers

James Cloos avatar

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.