Skip to Content
OchreML
MCP Tools

ochreml_predict

Run batch predictions using a saved .dit model on a CSV, TSV, or Parquet dataset.

ochreml_predict loads a persisted .dit model, runs inference on an input dataset, and returns a preview of predictions—optionally writing full predictions to a .csv or .json file inside the allowed MCP root.

It is backed by ochreml._ops.op_predict().

Input Schema

ParameterTypeRequiredDefaultDescription
model_pathstringYes—Path to .dit model file (.dit extension enforced).
data_pathstringYes—Path to input dataset (CSV, TSV, or Parquet).
out_pathstringNonullOptional output file path (.json writes {"predictions": [...]}, any other extension writes a single-column prediction CSV).
targetstringNonullOptional target column name to drop if present in data_path.

Guardrails

  • model_path is validated with require_dit=True.
  • data_path and optional out_path are validated with _resolve_contained().
  • If model.predict() returns multi-class logits (e.g. from nn.Sequential), _predict_model() automatically applies argmax per row.

Example JSON-RPC Call

{
  "jsonrpc": "2.0",
  "id": 7,
  "method": "tools/call",
  "params": {
    "name": "ochreml_predict",
    "arguments": {
      "model_path": "models/housing_ridge.dit",
      "data_path": "data/housing_test.csv",
      "out_path": "outputs/preds.csv",
      "target": "price"
    }
  }
}

Response Fields

FieldTypeDescription
model_pathstringResolved .dit model path.
model_typestringLoaded estimator class name.
n_samplesintegerTotal number of predictions produced.
out_pathstring | nullResolved output path if written, otherwise null.
predictions_previewnumber[]First 20 predicted values.
predictionsnumber[]Included only when out_path is omitted and n_samples <= 500.

On this page