To NYC Yellow Cab or to Uber?

Avatar
Posted on Nov 27, 2018

The iconic NYC Yellow Cab has been a staple on the streets of NYC for over 80 years now since the induction of the medallion system of 1937. However since the beginning of Uber and other ride sharing apps, such as Lyft and Via, the long standing supremacy of the yellow cab has been challenged. Not only do the ride hailing apps offer on-demand service, they also provide the user the cost of the ride up front. It has always been difficult to know how much a cab was going to cost due to the variables of traffic condition and times of day. Consequently, cab riders often wouldn't know in advance exactly how much that ride would cost them--until now. Using the data that's freely available to the public at nyc.gov by the NYC Taxi and Limousine Commission, I created a R shiny app that would predict the cost of an NYC yellow taxi given the pick up, drop off locations, and time of day information. Using in tandem with checking the price on the Uber app, the user would be able to make an informed decision about which service to use with transparency on the cost for each ride.

Data

Each individual csv contains every ride logged by all the medallion credited yellow taxis for a specific month. Each file captures data on pick-up/drop-off location and times, distance, itemized fares, rate types, payment types, and passenger counts. As the activity generates the over a GB of data each month, the files are quite large. To make it more manageable, for different graphs or features of the app I used either one month of the data, June 2018, or an aggregate of each month's data.

Dashboard

I first wanted to examine the Yellow Cab industry and see how ridership has been affected in the recent years. Due to each individual file being so large, I had to write the code to open each monthly file in the directory and create a new table of the counts of ridership for each month. From this I was able to get a picture of how the yellow cab has been hit quite hard in recent years; its ridership has dropped 54% since 2014. This decrease in ridership has not been offset by the slight increase in average ride cost, so the industry has seen a loss of $663M in annual revenue between 2014 and 2017.

The next page of the dashboard provides a little more insights into where and when the riders of NYC are going. Looking at the data for June 2018, we see the at each day follows a similar distribution of the time of day that riders are using cabs. Use is lightest during the early morning and heaviest in the afternoon. Also to note, that every day, starting on Monday, ridership increases more over the previous. I also provided a brief analysis into the most popular neighborhoods to be traveling from given the day and time of day.

Trip Estimator

Due to limitations built into shinyapps.io, I was only able to use a fraction of the data in the back end of the estimator, located on the dashboard tab. However, with input from the user Pickup Location, Destination Location, Day of Week, and Time of Day the app outputs an estimate of travel time, cost, and tip based on averages of all the other riders who have made that same trip.

For reference I have also provided a location id table for reference so you can confirm the neighborhood you are referencing is correct.

Next Steps

Improvements that I would like to implement to improve the app would be increasing the size of the database that the estimator is using. That would mean finding some way around the constraints set by the application website that allows files to be only so large. I would also like to add a heatmap which would be another visual reference for the distribution of rides in NYC.

 

About Author

Avatar

Kent Burgess

A data scientist with a focus on machine learning, big data, advanced statistics and analytics, R and Python development, data visualization and packages, SQL, and Git/Github. Ambitious professional with a track record of executing strategic business initiatives in...
View all posts by Kent Burgess >

Leave a Comment

No comments found.

View Posts by Categories


Our Recent Popular Posts


View Posts by Tags

2019 airbnb alumni Alumni Interview Alumni Spotlight alumni story Alumnus API artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Big Data bootcamp Bootcamp Prep Bundles California Cancer Research capstone Career citibike clustering Coding Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Industry Experts Job JP Morgan Chase Kaggle lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research meetup Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Open Data painter pandas Portfolio Development prediction Programming PwC python python machine learning python scrapy python web scraping python webscraping Python Workshop R R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest recommendation recommendation system regression Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Tableau Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping What to expect word cloud word2vec XGBoost yelp