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 / Flag | Default | Description |
|---|---|---|
model | required | Path to .dit model file |
data | required | Path to input dataset (.csv, .tsv, or .parquet) |
--out | None | Optional output file path (.csv writes a single prediction column; .json writes {"predictions": [...]}) |
--target | None | Optional target column name to drop if present in data |
--json | false | Emit structured JSON output |
Behavior Notes
- Multi-class neural models: If
model.predict(X)returns multi-column logits (e.g. annn.Sequentialclassifier),predictautomatically applies per-rowargmaxto emit predicted class indices. - Preview vs full output: The CLI response always includes
predictions_preview(the first 20 predictions). When--outis omitted andn_samples <= 500, the fullpredictionslist is also included in the payload. - Target column dropping: If
--targetis 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.csvWrite predictions to JSON and inspect the summary as JSON:
ochreml predict models/ridge.dit test.csv --out preds.json --json