Use historical financial data to predict future revenue and expenses and generate forecast reports with visual projections for future growth.
- Python (pandas, statsmodels, matplotlib)
- Excel (for viewing and simple analysis of the CSV files)
File: data/financials_monthly.csv
Columns:
Date– Month (from Jan 2020 to Dec 2024)Revenue– Monthly revenueExpenses– Monthly expenses
The data is synthetic but follows a realistic upward trend with seasonality and noise.
-
Data Preparation
- Load the dataset and set
Dateas a time index. - Visualize historical revenue and expenses.
- Load the dataset and set
-
Model Selection
- Use ARIMA (1,1,1) models separately for:
- Revenue time series
- Expenses time series
- Use ARIMA (1,1,1) models separately for:
-
Forecasting
- Generate forecasts for the next 12 months.
- Save results to
data/financials_forecast.csv.
-
Visualization
- Plot:
- Historical vs forecasted Revenue
- Historical vs forecasted Expenses
- Save plots to:
images/revenue_forecast.pngimages/expenses_forecast.png
- Plot:
data/financials_monthly.csv– Input historical datadata/financials_forecast.csv– (Generated after running the script/notebook) 12‑month forecastsfinancial_forecasting.py– Python script to run the full pipelinefinancial_forecasting_notebook.ipynb– Jupyter Notebook with step‑by‑step analysisimages/historical_revenue.png– Historical revenue plotimages/historical_expenses.png– Historical expenses plotimages/revenue_forecast.png– Forecast plot for revenue (generated when you run the script)images/expenses_forecast.png– Forecast plot for expenses (generated when you run the script)
- Make sure you have Python 3 installed.
- Install dependencies:
pip install pandas matplotlib statsmodels
- Navigate to this project folder (where
financial_forecasting.pyis located). - Run:
python financial_forecasting.py
- Check the outputs:
data/financials_forecast.csvimages/revenue_forecast.pngimages/expenses_forecast.png
- Install Jupyter:
pip install notebook
- Start Jupyter:
jupyter notebook
- Open
financial_forecasting_notebook.ipynband run all cells.
- Built a time series model (ARIMA) to forecast revenue and expenses.
- Produced 12‑month ahead forecasts for both metrics.
- Visualized growth trends and compared historical vs forecasted values.
- Demonstrated how forecasting can support budgeting and strategic planning.