Skip to Content
OchreML
Commands

predict

Run batch inference from a .dit model on CSV, TSV, or Parquet datasets and write results to CSV or JSON.

ochreml predict loads a saved .dit model, runs batch predictions on a tabular dataset, and optionally writes predictions to .csv or .json (^▽^).

Usage

ochreml predict <model> <data> [--out PATH] [--target COL] [--json]

Arguments & Flags

Argument / FlagDefaultDescription
modelrequiredPath to .dit model file
datarequiredPath to input dataset (.csv, .tsv, or .parquet)
--outNoneOptional output file path (.csv writes a single prediction column; .json writes {"predictions": [...]})
--targetNoneOptional target column name to drop if present in data
--jsonfalseEmit structured JSON output

Behavior Notes

  • Multi-class neural models: If model.predict(X) returns multi-column logits (e.g. an nn.Sequential classifier), predict automatically applies per-row argmax to emit predicted class indices.
  • Preview vs full output: The CLI response always includes predictions_preview (the first 20 predictions). When --out is omitted and n_samples <= 500, the full predictions list is also included in the payload.
  • Target column dropping: If --target is passed for a CSV/TSV file that does not contain that column, the flag is safely ignored.

Examples

Write predictions to CSV while dropping an existing label column:

ochreml predict models/ridge.dit test.csv --target price --out preds.csv

Write predictions to JSON and inspect the summary as JSON:

ochreml predict models/ridge.dit test.csv --out preds.json --json

On this page