Model and ReasoningModel expose a predict() method that accepts a dataset, validates it against the training-time schema, and returns a numpy.ndarray. If you’re working with a ReasoningModel and need both predictions and explanations, you can get both in a single round-trip.
Wrap your data in a Dataset
predict() requires an op.Dataset. You cannot pass a raw DataFrame or array directly. Build one from your inference rows with op.LocalDataset.from_*(...).upload() before calling the model.
The SDK validates the dataset’s columns against the model’s training-time schema before the call goes out. Missing or mismatched features raise a clear local error rather than a server-side 400, so you catch schema mismatches fast.
Predict and explain in one call
If you have aReasoningModel, use predict_and_explain() to avoid two separate round-trips. You get both the prediction array and a Reasoning object with per-sample feature attributions.
What predict() returns
predict() returns a numpy.ndarray. For binary classification, values are class probabilities. For regression, values are the predicted targets.
Next steps
Explanations
Understand which features drive each prediction using
model.explain() and model.get_global_drivers().Training
Learn how to train a
Model or ReasoningModel from your dataset.