Skip to content

ruchitasms/Revenue-Forecast-Predictive-Model-Dashboard-App

Repository files navigation

Revenue-Forecast-Predictive-Model-Dashboard-App

1. Project Initiation

The objective of this project was to develop a revenue forecasting solution for a digital wallet company. The primary goal was to analyze historical transaction data, create a predictive model to forecast future revenue, and present these insights through an interactive dashboard. The core deliverable is a comprehensive dashboard that displays key performance indicators and a visual representation of the forecasted revenue. The project was structured with a clear timeline, beginning with data sourcing and culminating in the deployment of a functional application.

2. Phases

The project was executed in three distinct phases:

● Data Source Preparation: The initial raw transaction data, contained in digital_wallet_transactions.csv, was too granular for time-series forecasting. The FFPM_DR_DataSourcePrep.ipynb notebook was used to aggregate this data into a daily format, which became the training dataset (train_daily_transactions_aggregated.csv). A separate dataset (test_predictions_aggregated.csv) was created to represent future dates, which would serve as the basis for the forecasts.

● Modelling: The FFPM_DR-Modelling.ipynb notebook was central to this phase. Multiple forecasting models, including XGBoost and Random Forest , were considered. Hyperparameter tuning was performed to identify the best model configuration. The final, optimized model was then applied to the future dataset to generate revenue and transaction forecasts. The results were merged with the historical data to create a single, comprehensive dataset (final_combined_forecast.csv) for the dashboard.

● Dashboard App Creation: A Streamlit application, built with Python and the FFPM_DBStr.py script, was created to serve as the final deliverable. This dashboard provides a user-friendly interface to visualize the historical data and the machine learning-generated forecasts. It includes interactive elements to allow users to filter data and switch between different chart types.

3. Assumptions & Execution

The project's execution was guided by several key assumptions:

● Data Scope: The analysis and forecasting were performed exclusively on successful transactions , as they represent actual revenue generation.

● Future Trends: The predictive models assume that the underlying trends and patterns observed in the historical data, such as seasonality and spending habits, will continue into the future.

● Exogenous Variables: The models utilized exogenous variables (like day_of_week, product_category, and location) to improve forecast accuracy. It was assumed these features would be available and consistent for future predictions. The execution was successful, with each phase progressing as planned. The data aggregation scripts ran without errors, and the models were successfully trained and used to generate forecasts. The final Streamlit dashboard was created to be a fully functional and interactive tool for a user to explore the results.

4. Technical Comparison: XGBoost vs. Random Forest

Both Random Forest and XGBoost are powerful machine learning algorithms based on decision trees, but they approach the problem from different angles.

● Random Forest: This is an ensemble learning method that works by building a large number of independent decision trees. Each tree is trained on a random subset of the data, and the final prediction is an average of the predictions from all the trees. The primary goal is to reduce variance and prevent overfitting. Because the trees are built in parallel and independently, it is a very stable and robust algorithm.

● XGBoost (Extreme Gradient Boosting): This is a gradient boosting algorithm. Instead of building trees independently, it builds them sequentially. Each new tree in the sequence is created to correct the errors made by the previous trees. It focuses on the residuals (the difference between the actual and predicted values) and iteratively improves the model. This makes XGBoost highly accurate and often a top performer in machine learning competitions. In this project, XGBoost outperformed Random Forest because its sequential, error-correcting nature allowed it to capture the complex, non-linear relationships and dependencies in the transaction data more effectively than the independent trees of the Random Forest model.

5. Results

The dashboard and the underlying analysis provided several key insights:

● Model Performance: The final model chosen for forecasting was XGBoost , which achieved an R2 score of 0.79 . This significantly outperformed the Random Forest model, which had an R2 score of 0.54. The higher R2 value indicates that XGBoost explains a much larger proportion of the variance in the revenue data, making it a more reliable and accurate forecasting tool for this project.

● Overall Performance: The dashboard successfully calculates and displays total revenue and transaction counts, with a clear separation between historical and forecasted metrics.

● Revenue & Transactions by Day: The charts for "Revenue by Day" and "Transactions by Day" highlight a clear weekly pattern. Both revenue and the number of transactions tend to be higher on weekends (Fridays, Saturdays, and Sundays) , suggesting that user engagement peaks at the end of the week.

● Top Categories: The analysis of top product categories revealed that "Flight Booking" and "Hotel Booking" are the primary drivers of revenue, while categories like "Gas Bill" and "Insurance Premium" have a smaller contribution.

● Predictive Insights: The forecasts successfully captured the historical trends and patterns, projecting continued growth in both revenue and transactions. The dashboard allows stakeholders to visualize and understand these future projections, aiding in strategic planning. The project successfully delivered a robust forecasting solution that is both data-driven and visually intuitive.

About

The objective of this project was to develop a revenue forecasting solution for a digital wallet company. The primary goal was to analyze historical transaction data, create a predictive model to forecast future revenue, and present these insights through an interactive dashboard.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors