Uber Fare and Demand Prediction, Data Analysis
By: Rishabh Kumar Pundhir
Tags: Predictive Modeling, Demand Prediction, Data Analysis, Uber, Price Prediction

Price Prediction using various predictive models:

Linear Regression (Baseline): Linear Regression finds out a linear relationship between explanatory variables and the target variable by giving appropriate weights to each explanatory variable.

Results for Linear Regression

2. Random Forrest Regressor (Baseline): Random Forest regressor is made up of various distinct decision trees which are collectively helpful in predicting the target value.

Results for Random Forest Regressor

3. XGBRegressor : As XGBoost is known for “Extreme Gradient Boosting” and it is an implementation of gradient boosting trees algorithm. XGBoost straight way prunes the nodes of the tree with low similarity score. Results for XGBRegressor is depicted below.

Results for XGBRegressor

4. K- Nearest Neighbors : This is a non-parametric and lazy learning algorithm. The KNN algorithm uses ‘feature similarity’ to predict the values of any new data points. The average of the values is taken to be the final prediction. Here grid search was used to calculate the best value of ‘K’ on which we perform our KNN Regressor model, the best value of ‘K’ was 39 from a list of [1 to 50]. The results after performing model are as seen below. For this ablation analysis was also used to improve our RMSE values, but there were only slight changes in the score values i.e. from 8.51 to 8.47.

Results for K- Nearest Neighbors

5. Neural Network : This model depicts a complex non-linear relationship between dependent and independent variables. Activation function used in this model for the project is ReLu. In this model Neural Network has been implemented using Sequential method API and number of epochs taken were ‘3' for getting better results. For model creation number of hidden layers used were ‘6’ and number of neurons in the input layer were ‘512’. Batch Normalization has also been used as this technique is used for training very deep neural networks that standardizes the inputs to a layer for each mini-batch. This has the effect of stabilizing the learning process and dramatically reducing the number of training epochs required to train deep networks.

Results for Neural Network

Demand Prediction using clustering method and other predictive algorithms:

For demand prediction the location features have been converted to the geological coordinates so that the distance and the area clusters could be determined. The regions are divided in terms of longitude and latitude with the help of K-Means Clustering. The count of the cabs booked from each cluster on each datetime value is grouped and we get the demand. Also the datetime is converted to new features i.e. day of week, date, month, year and a new data frame is made. The data has been standardized using MinMaxScaler so that all the features will have the exact same scale.

Models used for demand prediction:

Linear Regression : It finds out a linear relationship between explanatory variables and the target variable by giving appropriate weights to each explanatory variable.

Results for Linear Regression

2. Random Forest Regression : It is made up of various distinct decision trees which are collectively helpful in predicting the target value.

Results for Random Forest Regression

3. XGBREGRESSOR : It is an ensemble learning model involving training and combining individual models (known as base learners) to get a single prediction.