Concepts
Six ideas cover everything. They fit on one page.
The model
A model learns to predict one column from the others. That column is the target, and you name it at creation:
spavik.train("churn.csv", target="churn")Spavik infers the nature of the problem from it, which it calls the task:
| Target contains | Task | What predict returns |
|---|---|---|
Categories (0/1, yes/no, A/B/C) | classification | The class, plus a probability per class |
| Continuous numbers (an amount, a duration) | regression | A numeric value |
You do not choose: the target decides. Once fixed, the task never changes, even if you retrain.
The version
Every training run produces a version, numbered from 1. The active version serves predictions; earlier ones stay readable, which makes rolling back possible.
model.version # 3
model.donnees["latest_version"]A version carries its metrics, its comparison baselines, the number of rows learned from (n_train), and the engine that produced it. That last point matters: a version keeps being served by the engine that created it, so a platform upgrade does not change your existing predictions.
n_train and n_sampled_from
If n_sampled_from is larger than n_train, the engine sampled: your file had more usable rows than it kept. Not an error, but worth knowing.
Context data
Spavik does not tune weights like a neural network. It looks at examples at prediction time. That set of examples is the context data.
Two pleasant consequences. Training is fast and free, since there is nothing to optimise. And improving the model means giving it better examples, not relearning from scratch.
Prediction and forecasting
Two different operations, not to be confused.
predict | forecast | |
|---|---|---|
| Question asked | "For this row, what value?" | "For the next 7 days, what values?" |
| Needs a model | yes | no |
| Keeps anything | yes, a reusable model | no, nothing |
| Billing | per row, at the engine's price (1 on the default engine) | horizon times series |
Use predict when your rows are independent of one another: a customer, a transaction, a ticket. Use forecast when the order of time carries the information: sales per day, load per hour.
The feedback loop
This is what separates a frozen model from a service that improves.
predict -> reality happens -> submit_outcomes -> refresh -> predictYou report what actually happened (submit_outcomes), those outcomes accumulate, then refresh folds them into the context data and produces a new version. performance then tells you whether the model does better or worse than training announced.
See The feedback loop to set it up.
Automatic updates
At creation, auto_update lets incoming outcomes trigger the integration, without you calling refresh.
spavik.train("churn.csv", target="churn", auto_update=True)Watch out for one trap: one call to submit_outcomes is one batch. With auto_update, sending outcomes one at a time triggers one integration per outcome. Batch them.
Active, archived, deleted
A model is active while it serves predictions and counts against the plan's quota. Archiving it stops both: it keeps its versions, its predictions and its outcomes, and restoring it puts it back in service, taking a slot again. Deleting it is the only irreversible move: the artefacts leave the engine and the pending outcomes go with them. A training that fails leaves nothing behind.