Cashflow Forecasting
Summary¶
In the realm of financial management, accurately predicting cash flow is essential for both businesses and individuals to maintain financial stability and make informed decisions. Dedomena's Cash Flow Forecasting Neuron leverages advanced deep learning techniques to predict future balances, income, and expenses, confidence intervals and recurrent transactions, offering a reliable tool for financial planning.
How does it work? It's straightforward.
-
Submit your transactional data with a minimum of 3 months of transactions:
- The input data should be an array of JSONs with the following keys:
- date: Date of the transaction.
- amount: Amount of the transaction.
- description: Description or concept of the transaction.
- balance: Balance of the transaction before or after the operation is done.
- The input data should be an array of JSONs with the following keys:
-
Receive your forecasted data:
- The output will be a JSON with two arrays:
- "forecast" with the balance prediction for the next 30 days and the confidence interval for every day of the forecast.
- "recurrent transactions" with all the transactions identified as recurrent.
- The output will be a JSON with two arrays:
Warning
Forecasting is done on the fly. Dedomena AI never retains any historical or forecasted cash flow information, so you must copy the results before closing the tab or window to avoid losing the information.
This Neuron provides a simple and intuitive way to predict cash flow, get recurrent transactions and confidence intervals enabling users to manage their finances effectively. With high accuracy and ease of use, the Cash Flow Forecasting is a valuable tool for anyone looking to enhance their financial planning and stability.
Say goodbye to uncertainty in financial management. Embrace the power of Dedomena's Cash Flow Forecasting Neuron and make informed financial decisions with confidence.
Use Cases
Here are some key use cases for the Cash Flow Forecasting Neuron:
- Financial Planning: Helping businesses and individuals anticipate future cash flow, ensuring they have enough funds to cover upcoming expenses.
- Risk Management: Identifying periods of potential negative balances in advance, allowing for proactive measures to mitigate financial risk.
- Investment Strategies: Assisting investors in planning and optimizing their investment decisions based on predicted cash flow trends.
- Budgeting: Facilitating more accurate budgeting by providing forecasts based on historical financial data.
API & Endpoints¶
/{frequency}¶
POST /v2/cashflow
This endpoint generates cashflow forecasts, identifies recurrent transactions and define confidence intervals based on the provided data.
Headers:
token
: available via free trial or subscription.
Request Body:
date
(string): Date of the transaction.amount
(float): Amount of the transaction.description
(string): Description or concept of the transaction.balance
(float): Balance of the transaction before or after the operation is done.

Request Body - JSON Array¶
[
{"date": "2024-07-22",
"amount": 200.0,
"description": "TRANSFERENCIA DE PEDRO PEREZ PEREZ, CONCEPTO gastos tarjeta bbva.",
"balance": 642.46},
{"date": "2024-05-17",
"amount": -34.65,
"description": "COMPRA EN MERCADONA, MADRID, TARJ. :*123456",
"balance": 607.81},
"..."
{"date": "2024-08-11",
"amount": -13.4,
"description": "PAGO MOVIL EN SUPERMERCADOS DIA, ZARAGOZA, TARJ. :*123456",
"balance": 1230.41}
]
Response¶
200
{"forecast": [{"date": "2024-08-03T00:00:00",
"balance": 48.46,
"expenses_day_min": -136.14,
"incomes_day_min": 0.0,
"balance_day_min": -14.74,
"expenses_day_max": -11.55,
"incomes_day_max": 0.0,
"balance_day_max": 455.12,
"expenses_dayofweek_min": -138.62,
"incomes_dayofweek_min": 0.0,
"balances_dayofweek_min": -24.69,
"expenses_dayofweek_max": -1.35,
"incomes_dayofweek_max": 0.0,
"balances_dayofweek_max": 644.6,
"yhat95": 290.49,
"yhat05": -111.14},
{"date": "2024-08-04T00:00:00",
"balance": 48.07,
"expenses_day_min": -136.14,
"incomes_day_min": 0.0,
"balance_day_min": -14.74,
"expenses_day_max": -2.0,
"incomes_day_max": 0.0,
"balance_day_max": 450.77,
"expenses_dayofweek_min": -138.62,
"incomes_dayofweek_min": 0.0,
"balances_dayofweek_min": 41.46,
"expenses_dayofweek_max": -1.35,
"incomes_dayofweek_max": 2.4,
"balances_dayofweek_max": 644.6,
"yhat95": 325.59,
"yhat05": -117.51},
{"date": "2024-08-05T00:00:00",
"balance": 88.26,
"expenses_day_min": -138.62,
"incomes_day_min": 0.0,
"balance_day_min": 115.66,
"expenses_day_max": -2.0,
"incomes_day_max": 0.0,
"balance_day_max": 646.15,
"expenses_dayofweek_min": -138.62,
"incomes_dayofweek_min": 0.0,
"balances_dayofweek_min": -14.74,
"expenses_dayofweek_max": 0.0,
"incomes_dayofweek_max": 601.0,
"balances_dayofweek_max": 644.6,
"yhat95": 365.79,
"yhat05": -131.08}],
"recurrent_transactions": [{"date": "2024-05-07 00:00:00.0",
"description": "TRANSFERENCIA DE RAMON, CONCEPTO gastos tarjeta debito.",
"balance": 1041.77,
"amount": 601.0},
{"date": "2024-06-07 00:00:00.0",
"description": "TRANSFERENCIA DE RAMON, CONCEPTO gastos tarjeta debito.",
"balance": 676.15,
"amount": 601.0},
{"date": "2024-07-16 00:00:00.0",
"description": "PAGO MOVIL EN SUPERMERCADO DIA, LAS ROZAS, TARJ. :*123456",
"balance": 101.1,
"amount": -4.57},
{"date": "2024-06-12 00:00:00.0",
"description": "PAGO MOVIL EN SUPERMERCADO DIA, LAS ROZAS, TARJ. :*123456",
"balance": 636.26,
"amount": -8.34}]
}
402
[
{
"detail": "Could not validate credentials"
}
]
422
[
{
"detail": "Unprocessable Entity"
}
]
429
[
{
"detail": "The maximum monthly number of calls or predictions for your account has been exceeded"
}
]
Using Python¶
You can run this example from a Jupyter Notebook or Python script.
NOTE: you should replace the ... by the correct information in the following code:
import pandas as pd
import requests
# Read the data
data_request = pd.read_csv(...) ## Update with the at least 3 month of transactions dataset path and needed parameters.
# Change names and types
data_request.columns = ["date", "description", "amount", "balance"] # Optional: change columns names.
# Convert to JSON from Pandas dataframe
data_json = data_request.sample(100).to_json(orient='records') ## Here the data is sampled by taking 100 rows from the original data set. Please modify it as per your convenience.
# Define the Payload and save the request in a response object
payload = {'token': '...'} ## Update with the token from API tab.
response = requests.post(url="https://api.cashflow.dedomena.ai/v2/cashflow", params=payload, data=data_json)
print(response)
# Transform to Pandas dataframe the request response
response_forecast = pd.DataFrame(response.json()['forecast'])
response_recurrent = pd.DataFrame(response.json()['recurrent_transactions'])
# Check the results
response_forecast
response_recurrent
Metrics¶
Dedomena AI model's performance metrics ensure high accuracy and reliability: