<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/nyc-citi-bike-visualization-a-hint-of-future-transportation/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://blog.nycdatascience.com/featured/nyc-citi-bike-migration-visulization/"> R – NYC Data Science Academy Blog</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><img sizes="(max-width: 1024px) 100vw, 1024px" src="https://i1.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/08/Screen-Shot-2017-08-27-at-12.48.00-AM-1024x810.png?w=450" alt="" class="wp-post-image" data-recalc-dims="1">
<p><strong>Introduction</strong></p>
<p><span>Like all other sharing systems,  Airbnb the housing sharing system, Uber the car sharing system, Citi Bike is the network of bicycle rental stations intended for point-to-point transportation.</span></p>
<p><span>Citi Bike is New York City’s largest bike sharing system. It’s a convenient solution for trips that are too far to walk but too short for a taxi or the subway. The bike sharing system is combined with all other transportation methods available in the area for commuters.</span></p>
<p><img sizes="(max-width: 452px) 100vw, 452px" src="https://i1.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/08/Screen-Shot-2017-07-18-at-11.34.58-PM-1024x778.png?w=450&ssl=1" alt="" class="wp-image-23886" data-recalc-dims="1">Currently, there are about a million trips on average per month by Citi Bike riders. The system has 10,000 bicycles and 610 stations. By end of 2017, the total size of Citi Bike system will be 12,000 bikes and 750 stations. The grey area is the current service area. The yellow and blue areas represent the sections to be covered by end of 2017.</p>
<p> </p>
<p> </p>
<p><strong>The Optimization Questions</strong></p>
<p><span>Any Citi Bike client has come up against two frustrating scenarios: the empty dock at the start and full dock at the end of the trip. Researchers call this as “rebalancing” problem as part of “fleet optimization” questions.  This problem has attracted the attention of data scientists to develop complex methodologies to optimize the available bikes and open docks.</span></p>
<p><span>Following I attempt to utilize the shiny visualization app to provide a hint for the 3 questions:</span></p>
<ol>
<li><b>Fleet Routing Pattern Detection</b><span>: what are the most popular routes during peak hours and off-peak? What is the direction of the flow?</span></li>
<li><b>Station Balance Prediction</b><span>: what is the average volume of imbalance in the distributed system? What is the station-level inflow and outflow? Is it sensitive to the time? How does it look like in a time series? </span></li>
<li><b>Reducing rebalancing demand</b><span>: What are the riders’ activities like? Is it possible to rebalance through pricing schemes?</span></li>
</ol>
<p><span>The visualization app is intended to provide a way to explore different comparative measures at the route, station and system levels with spatial attributes and time series.</span></p>
<p> </p>
<p><b>The Data</b></p>
<p><span>Citi published Citi Bike Trip Histories – </span><a rel="nofollow" href="https://s3.amazonaws.com/tripdata/index.html" target="_blank"><span>downloadable files of Citi Bike trip data</span></a><span>. I used the Citi Bike data for the month of March 2017 (approximately 1 million observations). The data includes:</span></p>
<ul>
<li><span>Trip Duration (in seconds)</span></li>
<li><span>Start Time and Date</span></li>
<li><span>Stop Time and Date</span></li>
<li><span>Start Station Name</span></li>
<li><span>End Station Name</span></li>
<li><span>Station ID</span></li>
<li><span>Station Lat/Long</span></li>
<li><span>Bike ID</span></li>
<li><span>User Type (Customer = 24-hour pass or 7-day pass user; Subscriber = Annual Member)</span></li>
<li><span>Gender (Zero=unknown; 1=male; 2=female)</span></li>
<li><span>Year of Birth</span></li>
</ul>
<p><span>Before moving ahead with building the app, I was interested in exploring the data and identifying patterns of rebalancing. </span></p>
<p><b><i>Bar Chart 1</i></b><i><span> – Time wise imbalance (Peak/Off peak)</span></i></p>
<p><a rel="nofollow" href="https://i1.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/08/Screen-Shot-2017-07-25-at-12.23.43-AM-1.png?ssl=1" target="_blank"><img sizes="(max-width: 1024px) 100vw, 1024px" src="https://i1.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/08/Screen-Shot-2017-07-25-at-12.23.43-AM-1-1024x322.png?w=450&ssl=1" alt="" class="wp-image-23877" data-recalc-dims="1"></a></p>
<p><em><b>Bar Chart 2</b></em><span> -Location wise imbalance (Top 10 popular Station)</span></p>
<p><a rel="nofollow" href="https://i1.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/08/Screen-Shot-2017-07-25-at-12.26.51-AM.png?ssl=1" target="_blank"><img sizes="(max-width: 1024px) 100vw, 1024px" src="https://i2.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/08/Screen-Shot-2017-07-25-at-12.26.51-AM-1024x401.png?w=450&ssl=1" alt="" class="wp-image-23876" data-recalc-dims="1"></a></p>
<p> </p>
<p><strong>Insights</strong></p>
<p><span>On the interactive map, each dot presents a station.  The visualization will also provide options to identify popular routes by selecting date and hour range. The top popular routes are marked in orange as the lines between the spatial points. The direction of the routes is indicated by moving from the more red towards the more green dots.</span></p>
<p><span></span></p>
<p><a rel="nofollow" href="http://blog.nycdatascience.com/wp-content/uploads/2017/08/Citi-Bike.mp4" target="_blank">Citi Bike Daily Migration</a></p>
<p><strong>The Patterns</strong></p>
<p><span>Interesting patterns are observed. The most popular routes on the west side run through Central Park and Chelsea Pier. Grand central/Penn Station centered routes are also in the hottest route list. Outside Manhattan there are centers in Queen and Brooklyn initiating lots of popular routes. Riders bike more along the west and east streets than along north and south avenue. That makes sense in light of the fact that  there are more uptown and downtown subways than crosstown ones, and riders do utilize the Citi Bike as a an alternative transportation option.</span></p>
<p><span>While not enough bikes available in hot pick up stations, the docks are lacking in hot drop off stations. The red dots are where outflow of bikes exceeds the inflow of bikes The green dots are where inflow of bikes exceeds the outflow of bikes. In the other words, the green dots are the hot spot to pick up a bike(more inbound bikes) and the red(more empty docks) to drop them off. And The more extreme the color of dot is, the higher percentage change of the flows this stations has. The size and transparency of the dot is represented by the volume of  both inflow and outflow of the stations. The more obvious the dot is, the hotter spot the station is.</span></p>
<p><span>What caused the balancing problem? The map based interactive app provides an insight for predicting demand. The information displayed is the accumulated hourly variables based on dates selected. Details of statistic numbers is also available for each stations by zooming in.</span></p>
<p><span>New York has a classic peak commuter flow </span>pattern<span>.  Most commuters ride bikes towards the center of the town from its edge in the morning. At the end of the day, they ride the reverse way to the edge where they live, especially at the edge sections with fewer public transportations options.   </span></p>
<p> </p>
<p><strong>The Rider’s Activities</strong></p>
<p><span>What about the rider’s activities. Is there any pattern involved? The app provides insights of rider’s performance for reducing rebalancing demands. By studying rider’s activities, it will provides suggestions for potential solutions. </span></p>
<p><span>Below each bubble represents an age and gender group. The age is represented as the number on each bubble.  A negative correlation is observed between age and speed. The younger the rider is, the faster he/she rides. In similarity, the group in the thirties shows similar miles per trip. The performance between female and male group are also different.  The male groups in blue perform a higher speed level than female groups in red. </span></p>
<p><a rel="nofollow" href="https://i2.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/08/Screen-Shot-2017-07-25-at-12.02.28-AM.png?ssl=1" target="_blank"><img sizes="(max-width: 1024px) 100vw, 1024px" src="https://i0.wp.com/blog.nycdatascience.com/wp-content/uploads/2017/08/Screen-Shot-2017-07-25-at-12.02.28-AM-1024x595.png?w=450&ssl=1" alt="" class="wp-image-23881" data-recalc-dims="1"></a></p>
<p> </p>
<p><b>The Balancing Solutions</b></p>
<p><span>Is there solutions for rebalancing to cut the cost and improve the efficiency, instead of manually moving bikes via trucks, bike-draw trailers and sprinter vans from full stations to empty stations?  The moving will take crews travel in pairs 45 minutes to load a truck. </span></p>
<p><span>Citi Bike sought a way to get the riders to move the bikes themselves. In May it started the pilot Bike Angel. The reverse-commuter would be perfect target member of the <strong>Angel program.</strong> What is so appealing about the program is the bike sharing system could self -distribute its fleet with the proper incentives. The member can easily make 10 Amazon gift card with a few reverse trips. As a result, the demand of manually moving bike around would decrease.</span></p>
<p> </p>
<p><strong>The Conclusions</strong></p>
<p><span>The Visualization app provides the real time status of fleets: popular routes, inbound/outbound, net change, time series of stations, hot spot analysis and rider’s activities. It supports the self distributed fleet by establishing a baseline for identifying “healthy” rebalancing within the bike share system. It provides a hint for a future transportation solutions.</span></p>
<p> </p>
<p><b>The App</b></p>
<p><span>The interactive app is available on</span><a rel="nofollow" href="https://summersuny.shinyapps.io/SHINY/" target="_blank"> <span>Shiny.io</span></a><span>.</span></p>
<p>The post <a rel="nofollow" href="http://blog.nycdatascience.com/featured/nyc-citi-bike-migration-visulization/" target="_blank">NYC Citi Bike Visualization – A Hint of Future Transportation</a> appeared first on <a rel="nofollow" href="http://blog.nycdatascience.com/" target="_blank">NYC Data Science Academy Blog</a>.</p>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://blog.nycdatascience.com/featured/nyc-citi-bike-migration-visulization/"> R – NYC Data Science Academy Blog</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/miWPHwndPH0" height="1"></a></div>