
The problem
Most ML systems are evaluated as "what's the overall accuracy?" — a single headline number that hides what the system can and cannot do. For business automation, the headline accuracy is the wrong question. The right question is per-confidence-tier accuracy: at >95% confidence, what is the error rate? At 50-90%? Below 50%? The tiered answer is what makes confidence-based automation safe; the headline number is what makes it dangerous.
The honest-evaluation pattern says: every prediction returns a calibrated confidence, AND the system regularly scores those confidences against ground truth. If 95% confidence corresponds to 95% realized accuracy, the calibration is honest. If 95% confidence corresponds to 70% realized accuracy, the calibration is broken and the system is unsafe to automate on. Most ML pipelines never compute this; they report headline accuracy and call it done.
How it works
Aito's _evaluate operator runs a prediction against a held-out sample of the data and returns its accuracy next to the base accuracy of always predicting the most common value, so the team can see at a glance whether the prediction is actually better than guessing. The e-commerce demo's Model checks show each model's accuracy with a 95 % interval, the baseline, the gain and the sample size; a catalogue model passes when it beats the baseline by 10 points or more.
The honest-failure pattern is the load-bearing one: when _evaluate shows that a prediction yields +0.0 pp gain over baseline (the Return Risk row in the e-commerce demo: 97.5 % accuracy against a 97.5 % baseline of always guessing "not returned"), the system renders the row red and the application knows not to auto-process based on that prediction. The system saying "I cannot help here" is exactly what makes the predictions on adjacent fields safe.
{
"test": {
"$sample": {
"n": 200,
"seed": 0
}
},
"evaluate": {
"from": "order_lines",
"where": {
"product_sku.category": {
"$get": "product_sku.category"
},
"product_sku.pet_type": {
"$get": "product_sku.pet_type"
}
},
"predict": "returned"
},
"select": [
"accuracy",
"baseAccuracy",
"n"
]
}For the full architecture, see the technology overview. For the broader narrative across multiple use cases, read The Predictive Application. For the whole picture, see predictive e-commerce. For the whole picture, see predictive accounting.
See it live
This use case runs in 2 live demos today, the 🛒 E-commerce and 🧾 Accounting demos. Each link opens the view that shows it, where you can inspect the queries that produce the result.
Build it with Claude Code
Paste this prompt into Claude Code, or another coding agent, in your own codebase. It runs Aito locally from the Docker image, reads the API docs written for agents, and follows a working reference implementation.
Add honest evaluation to this codebase using Aito, a predictive database. The feature: score each of our predictions on held-out data against the baseline of guessing the most common value, and show plainly the ones that don't beat it. 1. Run Aito locally: `docker pull ghcr.io/aitohq/aito`, then follow https://aito.ai/docker/ to start it with your own API keys (keep them in the environment, never in code). 2. Read https://aito.ai/docs/api/llms.txt for the v2 query shapes before writing any query. 3. Read the use-case guide: https://aito.ai/use-cases/honest-evaluation/ 4. Use this reference implementation as the pattern (schema, data load and queries): https://github.com/AitoDotAI/aito-ecommerce-demo/blob/main/src/eval_service.py and https://github.com/AitoDotAI/aito-ecommerce-demo/blob/main/src/evidence/model_checks.py 5. Find the matching tables in this codebase, design the Aito schema for them (links between tables where we have foreign keys), and load a sample. 6. Check the numbers before building the view: compare a few of them against a direct count over the same rows (SQL or a short script), and report any that differ. 7. In the UI, show the evidence behind each number (the counts, the interval or $why), and leave out patterns with too little data behind them. Ask me before changing anything outside the new feature.
Frequently asked
How does this compare to standard ML evaluation (precision, recall, F1)?
Standard metrics tell you what fraction of predictions were correct. They do not tell you whether you can trust each prediction individually. For business automation, "this prediction is 95% confident" needs to mean "actually 95% accurate at that confidence level" — that is calibration, and it is typically not part of standard ML evaluation. _evaluate gives the held-out accuracy and the baseline it has to beat; calibration is a separate check on the same held-out sample. The two answer different questions.
Why is calibration the metric that matters for automation?
Confidence-tiered automation says "above 95%, auto-process; below 50%, manual." If the 95% confidence is actually 70% accurate, you are auto-processing wrong predictions and the error rate looks fine because the headline number averages high and low. The user sees: "system says 95%, it must be safe." It is not. Calibrated confidence is what makes the tiering work.
What happens when _evaluate finds a prediction that performs worse than baseline?
The application surfaces it as a failed prediction — red row in the dashboard, +0.0 pp gain or worse. The application then knows not to auto-process based on that prediction. This is the honest-failure pattern: the system actively reports where it cannot help, rather than silently failing.
Can the system show calibration over time, not just at one snapshot?
Yes — that is calibration monitoring. Run _evaluate on rolling windows (last 7 days, last 30 days, last quarter) and track the gain and the calibration per window. When they drift, the team can adjust thresholds before the auto-process tier starts producing errors.
Is this just naive Bayes calibration, or something more sophisticated?
The underlying inference is Bayesian over the columnar index, not naive Bayes specifically — feature selection and posterior calculation happen per query. The output is the probability given the evidence, not a sampled score from a discriminative model. Whether a given field is well calibrated is still something to measure on held-out data, not to assume.



