Capabilities
Train a model on a table where one column holds the value you want to predict: the target column. What that column holds decides the capability.
| Capability | Target column | Output |
|---|---|---|
| Binary classification | Two values, such as yes and no | A label, or the probability of one label |
| Multiclass classification | Three or more categories | A label, with a probability for each |
| Ordinal classification | Ordered categories, such as low, medium and high | An ordered category |
| Multilabel classification | Several two-value columns | Yes or no for each column |
| Regression | Numbers | A number, with a range |
| Count regression | Whole numbers of 0 or more | An expected count, with a range |
| Ranking | Relevance within groups | A score and a rank within each group |
| Forecasting | A future number or count | The same as regression or count regression |
Outputs have the same fields wherever you get them: predictions made during training, hosted predictions, batch CSV results and downloaded models.
Inputs
Send one flat table with one row per prediction: the target column, and input columns you will also have when you predict.
- Send as is: numbers, categories, dates, free text and embeddings. Missing values are fine.
- Dropped: IDs and columns with one repeated value. Free text is left out unless you ask 19th to read it; see Text.
| Input | Limit |
|---|---|
| Columns | Up to 2,048 input columns |
| Rows | No row limit. Training uses up to 200,000 rows and samples larger tables |
| Labeled rows | At least 2, unless 19th labels them for you |
| Embeddings | Up to 16 embedding columns, text columns and pairs combined |
Dates. A column is read as dates when its values are full dates, such as 2024-03-15 or 03/15/2024, with or without a time such as 2024-03-15 09:30. Each date becomes its day number, year, month, day and day of week, plus the hour when times vary. Send times in UTC, without an offset or ending in Z; a non-zero offset such as +02:00 is refused. Month-only values such as 2024-03 and epoch numbers aren’t read as dates; write them as full dates.
Text. Free-text columns, such as ticket messages, product descriptions or reviews, are left out by default, with a warning that names them. With the Training API, set text_columns to hosted and 19th reads them with its language model: you send the raw text when you train and when you predict, and 19th turns each text column into numbers the model can use. A column counts as free text when most of its values are different and they average four or more words. To override that, set a column to text or categorical in column_types.
Hosted predictions take the raw text, up to 64 KiB per cell. A downloaded model can’t read raw text on its own; see running models with text locally.
Embeddings. If you already make embeddings with your own model, send each one as a column. Each embedding holds 1–4,096 numbers and has the same length on every row. Cells holding JSON arrays are detected automatically. Base64 cells are not: declare the column as vector in column_types, and encode each cell as standard padded base64 of little-endian float32 numbers. Hosted predictions take each embedding as a JSON array or a base64 string.
Missing values. Missing numbers are filled in; columns with many gaps also get a missing-value flag. A missing category is treated as its own value. Rows with an empty target don’t count as labels, but they are still used in training.
Labeling. For binary and multiclass classification, 19th can label rows that have no target values. Labeling doesn’t support text or embedding columns yet; send labels when your table has them.
Modes and sizes
Two choices trade speed for accuracy: the training mode, which you pick before training, and the model size, which you pick after.
Training modes. Every capability trains in one of three modes. Higher modes take longer and give more accurate models.
| Mode | Use it when |
|---|---|
| Instant | You’re checking your table and setup, or iterating on columns |
| Standard | You want a good baseline model quickly |
| Ultra | You’re training the model you’ll put into production |
Ultra gives the highest accuracy, with the longest training time. A common path is to try your table on Instant, then train on Ultra once the columns are right.
Model sizes. Every run returns three model files.
| Size | What it is |
|---|---|
| Fast | The full model and the default |
| Turbo | A smaller model that predicts faster |
| Warpspeed | The smallest model, with the fastest predictions |
Results show how each size compares with Fast in accuracy and prediction speed, so you can see what a smaller file costs before you choose it. For example, train on Ultra, then pick Warpspeed if you need the fastest predictions and its accuracy is close enough to Fast for your use.
Classification
Predicts a label from a fixed set of labels.
Binary
Predicts one of two labels, such as whether a customer cancels. The target column has exactly two values.
Ask for a label, or for the probability of one label: the positive label. Name the positive label in the target column’s type: true for a true/false column, 1 for a 0/1 column. A probability output looks like this:
{
"event_probability": 0.31,
"label": "no",
"probabilities": [0.69, 0.31]
}
label is the more likely label, and probabilities follow classes in the response. event_probability is the probability of the positive label; label outputs leave it out.
Cutoffs. label is a 0.5 cutoff. To act only when the model is sure, use the probability output and set your own cutoff. Set it higher for costly actions and lower for cheap ones, and choose it on rows the model did not train on.
Multiclass
Predicts one of three or more categories, such as the team that should handle a ticket.
{
"label": "billing",
"probabilities": [0.72, 0.2, 0.08]
}
label is the most likely category, and probabilities follow classes in the response.
Ordinal
Predicts a category with a natural order, such as low, medium or high. List every category from lowest to highest.
{
"label": "low",
"probabilities": [0.46, 0.1, 0.44],
"expected_grade": 0.98,
"grade": "medium"
}
label is the most likely category. expected_grade averages the grades by their probabilities; a category’s grade is its position in the order, from 0, or its own value when every category is a number. grade is the category closest to expected_grade. Here low is most likely, but high is nearly as likely, so grade is medium. Use grade when an output one step off is better than one two steps off.
Multilabel
Predicts several yes/no labels for each row, such as whether a ticket is urgent and whether it’s about billing. Give one two-value target column per label.
{
"positive": [true, false],
"probabilities": [0.82, 0.1]
}
positive is true when its probability is at least 0.5. Both lists follow labels in the response.
Regression
Predicts a number, such as a house price, here in thousands.
{
"prediction": 500,
"mean": 500,
"quantiles_available": true,
"median": 495,
"levels": [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
"q9": [430, 452, 468, 482, 495, 508, 523, 545, 590],
"range80": [423.5, 599.5],
"range80_scale": 1.1
}
prediction is the expected value (mean). The output includes a range.
Count
Predicts how many times something happens, such as visits or claims. The target column holds whole numbers of 0 or more.
{
"prediction": 2.4,
"mean": 2.4,
"quantiles_available": true,
"median": 2.1,
"levels": [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9],
"q9": [0.3, 0.8, 1.2, 1.7, 2.1, 2.6, 3.1, 3.8, 4.9],
"range80": [0, 6],
"range80_scale": 1.2,
"p_zero": 0.14
}
prediction is the expected count and can be fractional. The output includes a range, with range80 rounded outward to whole numbers and never below 0. p_zero is the chance of a zero count, kept between 0.05 and 0.95.
Ranges
Every regression and count model predicts nine quantiles around its answer, from P10 to P90, and a likely range built from them. This is quantile regression.
For example, a model predicting a house price might expect $500k. There’s about a 1 in 10 chance the real price is below $430k (P10) and about a 1 in 10 chance it’s above $590k (P90). range80 is the likely range, $423.5k to $599.5k, calibrated to hold the real price about 8 times in 10. Show range80 as the likely range; use q9 when you need a specific level.
| Field | Meaning |
|---|---|
median | The middle value, P50; the same as q9[4] |
q9 | Nine quantiles, lowest to highest, at the levels in levels |
levels | The level of each q9 value, from 0.1 to 0.9 |
range80 | [low, high]: the P10 and P90 values, scaled around the median by range80_scale |
range80_scale | How much range80 is widened or narrowed from the ends of q9; 1 means unchanged |
These fields are present when quantiles_available is true. Older models return only prediction.
Ranking
Orders candidates within a group, such as products for one search. The target column holds relevance, 0 or more, and a group column says which rows compete; a candidate column is optional. Leave the group and candidate columns out of the inputs, and include them when you predict.
{
"score": 2.31,
"prediction": 2.31,
"rank": 1,
"group": "search-17"
}
score only compares rows in the same group. rank 1 is the best in its group among the rows of one request, so send a group’s candidates together.
Forecasting
Predicts a future value with a regression or count model. Use one row per thing and point in time, such as one row per store per week; there is no separate time-series type.
store,week,sales_last_week,sales_4_weeks_ago,promo_next_week,sales_next_week
Downtown,2024-03-04,1840,1720,false,1910
Downtown,2024-03-11,1910,1800,true,2280
Airport,2024-03-04,960,1010,false,940
- Make the target the value to forecast, here
sales_next_week. - Put what you know on the forecast date in input columns: the date, past values such as
sales_last_week, and anything planned ahead, such aspromo_next_week. Leave out anything recorded after the forecast date. - Send past values of the target as raw numbers in the same units as the target, as
sales_last_weekis here. Don’t scale them or turn them into differences. 19th recognizes them and uses them to follow trends and level shifts beyond the range of the training rows. - Keep many stores in one table with a store column; one model covers them all.
- Dates are split into parts automatically, but holidays aren’t. Add a holiday column if they matter. Send dates in UTC.
- To check a forecast, train on earlier rows, then compare predictions for the latest period with what happened.
Several steps ahead. Each row predicts one value, so stack the steps: repeat each row once per step ahead, add a column such as weeks_ahead, and make the target the value that many weeks later. Past values stay as of the forecast date, so sales_last_week is the same on every stacked row. One model covers every step, and each prediction has its own range.
store,week,weeks_ahead,sales_last_week,promo_target_week,sales_target_week
Downtown,2024-03-04,1,1840,false,1910
Downtown,2024-03-04,2,1840,true,2280
Downtown,2024-03-04,3,1840,false,1950
You can also feed predictions back in: predict next week, use that prediction as the latest past value, and predict again. Its ranges cover one step at a time.