Jerome NazarioHow I build and ship real products
← Back

AI Tool Spending Predictor

Machine Learning Engineer (Academic) · R² 0.93 · 2 min read

AI subscriptions have quietly become a real line item — a copilot here, an image model there, a chat plan on top. This project asks a practical question: what actually drives how much a person spends on AI tools each month? The answer is a Multiple Linear Regression model built with Python and Scikit-Learn, packaged as a Google Colab notebook anyone can run.

Four suspects, one number

The model predicts monthly AI spending (USD) from four features, each with a plausible story behind it:

  • Number of AI tool subscriptions — more tools, more bills (1–10).
  • Daily usage hours — heavy users buy heavier plans (0.5–8 hrs).
  • Monthly income — budget sets the ceiling (USD).
  • Years of tech experience — veterans know what's worth paying for (0–20).

The hypothesis: someone who subscribes to more tools, uses them longer, earns more, and has been in tech longer will spend more. The model's job is to say how much each factor matters — and whether the hypothesis survives contact with data.

The notebook, start to finish

The 60-record dataset loads straight from GitHub, and the notebook walks the full MLR pipeline in order — no hidden steps, every cell visible:

The pipeline

CSV in, personal prediction out.

Load, correlate, fit, evaluate, predict — the standard regression workflow, kept deliberately readable so the method is as inspectable as the result.

Step 1
Load
60 records straight off GitHubpd.read_csv() on the raw dataset URL — four features, one target
Step 2
Correlate
A Seaborn heatmap names the suspectsdaily usage hours and subscription count light up against spending
Step 3
Fit
LinearRegression() on an 80/20 splitintercept and four slopes become the regression equation
Step 4
Evaluate
MSE, RMSE, R² on held-out dataplus an actual-vs-predicted scatter against the perfect-fit line
Step 5
Predict
Type your own numbers inthe notebook ends with an interactive estimate of your monthly spend
80/20 split

The model is scored only on data it never saw during training.

Heatmap first

Correlation analysis before fitting — daily usage hours and subscription count emerge as the strongest predictors.

How wrong is it?

On the held-out test set the model reaches an R² of ~0.93 — it explains about 93% of the variance in monthly spending — with an RMSE of ~$11, meaning predictions land within about eleven dollars of reality on average. The actual-vs-predicted scatter hugs the perfect-fit line closely enough that the R² annotation almost feels redundant.

monthly_ai_spending = β₀ + β₁(num_ai_tools) + β₂(daily_usage_hours) + β₃(monthly_income_usd) + β₄(tech_experience_years) — the whole model is one interpretable equation. Every coefficient says, in dollars, what one more tool, one more hour, or one more year is worth.

Run it on yourself

The notebook ends with an interactive predictor: open it in Colab, run the cells, and in the final step type your own numbers — tools, hours, income, experience — to get a personalized estimate of what someone with your profile spends on AI each month. The dataset, notebook, and README live in the GitHub repo linked below.

Tech stack
View notebook