JETIR2305738

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

© 2023 JETIR May 2023, Volume 10, Issue 5 www.jetir.

org (ISSN-2349-
5162)

Dynamic Pricing for taxi fares based on demand,


weather and fuel price
Chandramouli P Gnnanavel S Dr. Venkatesan Selvam
IV Year IV Year Professor
Department of Computer Science and Department of Computer Science and Department of Computer Science and
Engineering Engineering Engineering
B.S.Abdur Rahman Institute of B.S.Abdur Rahman Institute of B.S.Abdur Rahman Institute of
Science and Technology Science and Technology Science and Technology
Chennai 600 048 Chennai 600 048 Chennai 600 048

Abstract - The transportation industry has been rapidly evolving over the to revolutionize the taxi industry by making taxi rides more
past few years, with ridesharing and taxi services becoming increasingly affordable and efficient for passengers, while also ensuring that
popular. To stay competitive, it is important for taxi companies to adopt drivers receive fair compensation for their services. There is several
innovative strategies to attract and retain customers. One approach is to existing dynamic pricing software for taxi rides, such as Uber's
develop a dynamic pricing system that can adjust fares in real-time based
surge pricing and Lyft's prime time pricing. However, these pricing
on various factors, such as demand, weather, and fuel prices. This project
aims to design an intelligent pricing system for taxi rides that can analyse models have faced criticism from customers for their high prices
and interpret data related to demand, weather, and fuel prices, and use during peak demand times. Additionally, some drivers have
this information to adjust fares dynamically. The proposed system will expressed frustration with the lack of transparency in how surge
incorporate data analytics to optimize pricing. In the proposed system, pricing is calculated and how much of the increased fare they
historical data related to demand, weather, and fuel prices in different receive. Other dynamic pricing software used in the airline and hotel
areas are collected and analysed. The system will use insights derived industries may not be directly applicable to the taxi industry due to
from the data analysis to create a formula to adjust fares dynamically in differences in demand patterns and customer behaviour. In the
real-time, ensuring that customers are charged a fair price for their ride airline industry, dynamic pricing has been used for decades to adjust
and drivers are fairly compensated for their services. The proposed system
will provide an easy-to-use interface for both customers and drivers,
ticket prices based on the demand for a particular flight. Airlines use
allowing them to view the estimated fare for a particular ride before complex algorithms to predict demand and adjust ticket prices
booking. accordingly. For example, if there is a high demand for a particular
flight, the airline will increase the price of the ticket to maximize
Keywords - dynamic, Insights, weather, demand, fuel. revenue. On the other hand, if there is low demand for a particular
flight, the airline will lower the ticket price to attract more
customers. In the hospitality industry, hotels use dynamic pricing to
I. INTRODUCTION adjust room rates based on demand and other factors such as
seasonality, events, and even weather conditions. For example, a
In today's fast-paced world, people depend on taxis for
hotel in a tourist destination may increase room rates during peak
transportation needs more than ever before. However, the traditional
tourist season, or during major events such as festivals or concerts.
pricing model, where the fare is based solely on distance and time,
Similarly, if there is inclement weather, a hotel may lower room
may not be the most efficient way to meet the needs of the riders
rates to attract more guests. However, the application of dynamic
and the drivers. The aim of this project is to design a dynamic
pricing in the taxi industry is still in its early stages. Unlike airlines
pricing system for taxi rides that will intelligently change the pricing
and hotels, taxis are a much more fragmented market with many
based on demand, weather, and fuel prices. By using advanced
small and independent operators. Moreover, there are various
algorithms, this system will predict the demand and supply of taxis
factors that need to be taken into consideration for dynamic pricing
in real-time and adjust the pricing accordingly. The system will take
in the taxi industry, such as traffic conditions, fuel prices, and the
into consideration various factors such as weather conditions, fuel
availability of drivers. One major challenge in implementing
prices, and current demand to ensure that both passengers and
dynamic pricing for taxis is the lack of data. Airlines and hotels have
drivers are satisfied with the pricing. This project has the potential

JETIR2305738 Journal of Emerging Technologies and Innovative Research (JETIR) www.jetir.org h341
© 2023 JETIR May 2023, Volume 10, Issue 5 www.jetir.org (ISSN-2349-5162)
access to a vast amount of data such as booking trends, customer wind_gust, pressure_avg, pressure_max, pressure_min,
preferences, and historical pricing data. In contrast, the taxi industry precipitation, snow_depth.
has limited data on demand patterns, driver availability, and traffic
conditions. To overcome this challenge, taxi companies are 3. DATA CLEANING
increasingly relying on technology to collect and analyze data from
various sources such as Global Positioning System (GPS), weather To ensure the accuracy of the analysis, it is important to clean the
forecasts, and social media. Another challenge is the potential for data. The cleaning process may involve the removal of missing
backlash from customers. While dynamic pricing can help taxi values, outliers, and other anomalies that can affect the analysis. The
companies maximize revenue, it can also lead to price data can also be pre-processed to extract useful features that can be
discrimination and create a perception of unfairness among used for analysis. For example, the data can be converted to hourly
customers. For example, a customer may be charged a higher price or daily aggregates to capture the demand pattern. Furthermore, it is
for a ride during peak hours, while another customer traveling at the important to ensure that the data is consistent across different
same time may be charged a lower price due to different demand sources, such as the pickup and drop off location and time, to
patterns in their respective areas. prevent errors in the analysis. The cleaning process can be
performed using programming languages such as Python.
II. RELATED WORKS
4. DATA TRANSFORMATION
There are a few existing systems that aim to provide dynamic pricing
for the taxi industry. One such system is Uber's surge pricing Data transformation is an important process in data analysis where
algorithm, which increases the fare during peak hours or when raw data is transformed into a more structured format that can be
demand is high. Another example is Lyft's Personal Power Zones, easily analyzed. This process involves the conversion of data from
which offer drivers higher pay rates for driving in areas with high one format or structure to another, which may include filtering,
demand. Other systems include Curb, which uses real-time data to sorting, grouping, aggregating, or merging data sets. Data
optimize pricing and match supply with demand, and Arro, which transformation is important because it helps to standardize data,
offers dynamic pricing and a fixed fare option. Some taxi companies making it easier to analyze and understand. In the case of the New
have also developed their own dynamic pricing systems, such as York taxi dataset, data transformation is necessary to make sense of
Flywheel's taximeter-based system that adjusts the fare based on the large amount of data that is generated by the taxi system. This
demand and traffic. involves cleaning, filtering, and organizing the data to extract
While these systems have been successful in their respective meaningful information about taxi rides, such as pickup and dropoff
markets, they are not without their limitations. Surge pricing has locations, trip duration, and fare amounts. Data transformation is an
received criticism from consumers who feel they are being unfairly iterative process that involves testing different transformation
charged, while drivers have expressed frustration with unpredictable methods until the desired results are achieved.
earnings. Additionally, some of these systems are proprietary and
5. FEATURE ENGINEERING
only available to drivers who work for specific companies, limiting
their impact on the industry. As such, there is a need for an open and Feature engineering is the process of creating new features from the
adaptable system that can be used by any taxi company or existing data that can improve the performance of the forecasting
independent driver. A system that considers various factors such as model. In this project, relevant features, such as seasonality, trend,
weather, traffic, and fuel prices, and provides an optimal pricing and lagged values, were extracted from the dataset to capture the
strategy and transparency that benefits both drivers and passengers. underlying patterns and trends in the data.
III. METHODOLOGY 6. DATA VISUALISATION

1. DATA DESCRIPTION FOR TAXI DATA Data visualization is an important step in the data analysis process
as it helps to communicate insights in a more intuitive and
The New York Taxi dataset is divided into separate files for each understandable way. In the context of this project, data visualization
month from January 2009 to June 2022. Each file contains is particularly useful for gaining insights into the patterns and trends
approximately 10 million rows and 20 columns of data. The in the New York taxi dataset and the New York weather data.
columns names include VendorID, tpep_pickup_datetime, Through visualizations, we can identify peak hours, popular pickup
tpep_dropoff_datetime, passenger_count, trip_distance, and drop-off locations, and other important features that could
RatecodeID, store_and_fwd_flag, PULocationID, impact the demand for taxi services. Correlation between weather
DOLocationID, payment_type, fare_amount, extra, mta_tax, data and taxi data can be found through data visualization. By
tip_amount, tolls_amount, improvement_surcharge, plotting the taxi data with the corresponding weather data, patterns
total_amount. and trends can be observed. For example, a scatter plot of the
number of taxi pickups vs. temperature can show whether there is a
2. DATA DESCRIPTION FOR WEATHER DATA relationship between the two variables. If there is a positive
correlation between the two, the points on the scatter plot will trend
The New York weather dataset provides hourly weather upwards, indicating that as temperature increases, so does the
observations collected by the National Oceanic and Atmospheric number of taxi pickups. Similarly, a scatter plot of taxi pickups vs.
Administration (NOAA) for Central Park in New York City. The precipitation can show whether there is a relationship between the
dataset contains weather data from January 1st, 2010, to December two variables. If there is a negative correlation between the two, the
31st, 2022. The columns names include date, temp_avg, points on the scatter plot will trend downwards, indicating that as
temp_max, temp_min, dew_point_avg, dew_point_max, precipitation increases, the number of taxi pickups decreases.
dew_point_min, humidity_avg, humidity_max, humidity_min,
wind_speed_avg, wind_speed_max, wind_speed_min,

JETIR2305738 Journal of Emerging Technologies and Innovative Research (JETIR) www.jetir.org h342
© 2023 JETIR May 2023, Volume 10, Issue 5 www.jetir.org (ISSN-2349-5162)
respectively. If the weather is rainy or traffic is high, the charge rate
increases. Otherwise, the rate remains constant at 1.
The fuelprice_per_km is a constant value that represents the cost of
fuel per kilometer traveled, and this value is factored into the
calculation of the fare. Surge_charge_rate is a dynamic fare
multiplier that is calculated in real-time using data from the Google
Maps platform. This value is used to adjust the fare based on the
current demand for rides.
The item multiplier is a multiplier that is applied to the fare based
on the type of taxi that is selected for the ride. Each type of taxi may
have a different multiplier that affects the price of the trip. Finally,
usd_to_inr is a currency converter that is used to convert the fare
from US dollars to Indian rupees. This conversion is necessary
because the formula for calculating the fare is derived from New
York taxi data and is based on US dollars.
To Summarize, the fare calculation system considers a variety of
factors, including distance, time, weather, traffic, fuel prices, surge
pricing, and taxi type. These factors work together to provide a fair
Figure 1 : Pick up hour vs number of pick ups and accurate fare estimate for passengers, while ensuring that taxi
companies and drivers are appropriately compensated for their
services.

8. ARCHITECTURE

The user enters the pick-up and drop off location which is assisted
by the places API as it suggests or auto completes the location. Next
using the pickup and drop off locations the direction API finds the
direction between the 2 locations. The distance matrix API uses this
information to find the distance between the 2 locations and estimate
the duration. With this information the initial cost is identified.
Additionally, the location and time information are sent to traffic
API and weather API which is going to check the weather and the
traffic in the surroundings. If the weather condition is bad or there
is a huge traffic near the area, then the pricing will be increased
Figure 2: correlation between no. of trips, avg. fair and avg. distance accordingly. The Distance Matrix API is a service that provides
travel distance and time for a matrix of origins and destinations. This
In the weekdays the demand peak between 7:00 to 10:00 and again API is used to calculate travel times between different locations and
in between 16:00 to 19:00 (figure 1). But at the weekends, especially optimize routes for your taxi service. The Directions API is a service
during Friday and Saturday nights the demand increases. This is that calculates directions between locations using an HTTP request.
because the New Yorker like to go on an outing which is a common This API is used to get directions between two points and optimize
culture among working class people around the world. routes for your taxi service. The Places API is a service that returns
information about places using HTTP requests. This API is used to
A strong correlation is noted between average fair and distance find places such as restaurants and hotels near a specific location.
(figure 2), while a weak negative correlation is seen between fair Traffic API: The Traffic API provides real-time traffic data for
and number of trips. Thus, stating that distance has a huge effect on different locations. This API is used to get information about traffic
price. conditions in real-time and optimize routes for your taxi service.
Weather API: The Weather API provides weather forecasts for
7. ALGORITHM
different locations. This API is used to get information about
weather conditions in real-time and optimize routes for your taxi
Predicted Price = BaseFare + (( TravelTimeInformation *
service.
Per_Min_Charge * Per_KM_Charge * Weather_Charge_Rate
* Traffic_Charge_Rate * FuelPrice_Per_KM *
Surge_Charge_Rate * Item_Mutipiler) / USD_TO_INR )

The base fare is a fixed minimum charge that is applied to all types
of rides. The traveltimeinformation API provides the distance and
time taken to travel from the origin to destination entered by the
user, and this value is multiplied to determine the distance and time
taken charge.
The per_min_charge and per_km_charge are constant values that
determine the charge per minute and per kilometer traveled
respectively. These values are used in conjunction with the distance
and time taken to calculate the fare for the trip. Additionally,
weather_charge_rate and traffic_charge_rate are API data that
provide a rate for weather conditions and traffic conditions
Figure 3: architecture diagram

JETIR2305738 Journal of Emerging Technologies and Innovative Research (JETIR) www.jetir.org h343
© 2023 JETIR May 2023, Volume 10, Issue 5 www.jetir.org (ISSN-2349-5162)
Approach for Taxi Demand Prediction Based on Time Series
9. IMPLEMENTATION
Analysis”, IEEE Access, 8, 109634-109645, 2020.
The first step is for the user to enter the pickup and drop off location, [4] Wei Zhu, Ying Wang, and Bing Yu, “A Taxi Demand
which is assisted by the Places API. The Places API is a web service Prediction Model Based on Gradient Boosting Decision Tree”,
that provides information about places using HTTP requests. It can IEEE Access, 8, 91895-91905, 2020.
be used to search for places, get detailed information about a place, [5] Chiwei Yan, Helin Zhu, Nikita Korolko and Dawn
or even autocomplete a user's search query. This is particularly Woodard, “Dynamic Pricing and Matching in Ride-Hailing
useful when dealing with user input, as it reduces the likelihood of Platforms”, Management Science, pp. 3008-3013, 2019.
errors or typos.
Once the pickup and drop off locations are identified, the Direction [6] Tanaya Dey, K. C. Santosh, and K. N. Chidambaranathan,
API is used to find the direction between the two locations. The “Predicting Taxi Demand in a City Based on Spatio-Temporal
Direction API is a service that calculates directions between Analysis”, Transportation Research Part C: Emerging
locations using an HTTP request. It can be used to determine the Technologies, pp. 142-147, 2019.
shortest route between two locations or to get turn-by-turn [7] Harikrishnan Nair, Alok Ranjan Pal, Nisheeth Srivastava,
directions. This API helps to identify the most efficient and quickest and Vasudeva Varma, “Real-Time Demand Prediction of Taxi
route between the two points, which in turn helps to calculate the Services Using Convolutional Neural Networks and Traffic Data”,
distance and duration of the trip. IEEE Transactions on Intelligent Transportation Systems, pp. 154-
The Distance Matrix API is then used to find the distance between 163, 2019.
the two locations and estimate the duration. This API calculates [8] M. Li, Y. Wang, and K. Zhang, "Quantifying the Impact of
travel distance and time for a matrix of origins and destinations
Rainfall on Taxi Hailing and Operation," in 2019 IEEE International
using an HTTP request. It provides information about the shortest
Conference on Big Data (Big Data), Los Angeles, CA, USA, pp.
route, distance, and travel time between multiple origins and
3598-3605, 2019
destinations. This information is used to estimate the initial cost of
the trip. [9] L. A. Pagel and H. J. Prast, "Flexible Ubers and Fixed Taxis:
Additionally, the location and time information are sent to the the Effect of Fuel Prices on Car Services," 2019 IEEE International
Traffic API and Weather API to check the weather and traffic in the Conference on Smart Computing (SMARTCOMP), Washington,
surroundings. The Traffic API provides real-time traffic DC, USA, pp. 16-23, 2019.
information, such as accidents and construction, along with traffic [10] M. Fan, Y. Wu, H. Liu, J. Ma, and S. Zhou, "Modeling the
flow and speed data. This data helps to estimate the traffic condition effect of days and road type on peak period travels using structural
around the pickup and drop off location, which can affect the equation modeling and big data from radio frequency identification
duration and cost of the ride. Similarly, the Weather API provides for private cars and taxis," in 2019 IEEE International Conference
real-time weather information, such as temperature, precipitation, on Big Data (Big Data), Los Angeles, CA, USA, pp. 5234-5239,
and wind speed, which can affect the safety and comfort of the ride. 2019.
If the weather conditions are bad or there is a high traffic near the
[11] K. R. Ke, Y. Shi, and Y. Zhu, "The impact of ride-hail surge
area, then the pricing will be increased accordingly.
factors on taxi bookings," 2019 IEEE International Conference on
IV. CONCLUSION Intelligence and Safety for Robotics (ISR), Shenyang, China, pp.
22-27, 2019.
Considering the overall aim of the project to implement dynamic [12] Qingpeng Cai, Junliang He, and Yongxiang Xia, “Data-
pricing for taxi services, the proposed system has shown to be Driven Dynamic Pricing for Ride-Sharing Services”, IEEE
successful in detecting changes in weather and traffic conditions and Transactions on Intelligent Transportation Systems, 20(6), 2256-
adjusting the pricing accordingly. The system uses APIs like the 2269, 2018.
Distance Matrix API, Places API, Weather API, and Traffic API to [13] Aqsa Moazam, Muhammad Usman Ghani Khan, and
gather real-time data and make accurate pricing predictions. In Syed Ali Hassan, “Predicting Taxi Demand Using Convolutional
conclusion, the proposed system has demonstrated the potential for Neural Networks and Ranking Techniques”, IEEE Access, pp. 429-
implementing dynamic pricing in the taxi industry, which can help 434, 2018.
increase the efficiency and profitability of the business while also
providing customers with a fair and transparent pricing model. By [14] Puneet Singh, Ankit Jain, Rohan Kumar, and Tushar
leveraging the power of machine learning and real-time data Agarwal, “Predicting Demand for a Citywide Taxi Service Using
analysis, the proposed system has the potential to revolutionize the Deep Learning”, IEEE Transactions on Intelligent Transportation
way taxi services are priced and improve the overall user Systems, pp. 846-853, 2018.
experience. [15] Dapeng Li, Zhiyuan Liu, and Yanping Zhang, “Dynamic
Pricing Strategies in a Competitive Ride-Hailing Market”,
V . REFERENCES Transportation Research Part C: Emerging Technologies, 85, 591-
606, 2017.
[1] Zhizhen Liu, Hong Chen, Yan Li, and Qi Zhang, “Taxi
[16] K. B. Biswal and A. K. Pradhan, "Traffic Operations and
Demand Prediction Based on a Combination Forecasting Model in
Capacity Analysis in India," 2017 International Conference on
Hotspots”, Mathematical Problems in Engineering,1-13, 2020.
Wireless Communications, Signal Processing and Networking
[2] Nicolas Gast, Thomas Parisini, and Antonio Siconolfi, (WiSPNET), Chennai, India, pp. 1420-1424, 2017.
“Demand and Revenue Management in Ride-Sharing: A Network
Revenue Management Approach”, IEEE Transactions on Intelligent
Transportation Systems, 137, 350-373, 2020.
[3] Jun Yan, Weiwei Sun, and Xianyi Zeng, “A Deep Learning

JETIR2305738 Journal of Emerging Technologies and Innovative Research (JETIR) www.jetir.org h344

You might also like