How SpendWise predicts your spending before it happens
We built a linear regression model on three months of historical data. Here's exactly how it works — and why it's right 87% of the time.
Aarav Krishnan
Founding Engineer
Most expense trackers show you what you spent. SpendWise tells you what you're going to spend. Here's how the prediction engine actually works under the hood.
The setup
When you log expenses for at least 30 days, we have enough data to fit a per-category linear regression. We treat days-since-month-start as the X axis and cumulative spend as Y. The slope of that line is your daily burn rate, and projecting it to month-end gives the forecast.
Why linear regression?
We tested ARIMA, exponential smoothing, and a tiny LSTM. For 30-day windows with weekly seasonality, plain old least-squares regression with a weekend dummy variable beat all of them on RMSE. Simpler also means we can run it on-device in <50ms.
Anomaly detection
Separately, we compute a z-score on each new expense relative to your category history. Anything above 2.5 standard deviations gets flagged as 'unusual'. This is what surfaces alerts like 'You spent 3x your usual on transport this week'.
The goal isn't to be a black-box AI. It's to make small, explainable predictions you can actually trust and act on.
Results so far
Across the first 12,000 students, our forecasts land within ±8% of the actual month-end total 87% of the time. The ones we miss are usually 'lifestyle shock' months — moving hostels, festival spending, etc. We're working on detecting those upfront.