Models

Run predictions

Run predictions with a trained ML model.

Identify the model by ml_model_id, or by ml_model_name (the name of a non-archived model). Each row in data maps the model's feature columns to values; list_ml_models shows the columns each model expects. Returns one prediction per input row, plus per-class probabilities for classifiers.

Requires an API key with the read scope.

post/api/v1/ml-models/predict

Request

  • Base URL: https://platform.labric.co
  • URL: https://platform.labric.co/api/v1/ml-models/predict
  • Auth: HTTP bearer

Request body

pixel_thresholdnumber double

Segmentation models only. A pixel belongs to a predicted region when the model's probability for it exceeds this. Lower values find fainter regions and grow existing ones. Higher values keep only confident pixels. Probabilities are uncalibrated, so useful values depend on the model.

min_region_pixelsinteger

Segmentation models only. Drops predicted regions with fewer pixels than this. Pixels are counted on the hole-filled mask at the model's inference resolution.

max_hole_pixelsinteger nullable

Segmentation models only. Fills enclosed holes of up to this many pixels in each predicted mask before it is split into regions. Null fills every hole. 0 keeps all holes, so ring-shaped predictions stay rings.

min_confidencenumber double

Segmentation models only. Drops predicted regions whose confidence, the mean probability of their pixels, is below this.

ml_model_idstring uuid nullable
ml_model_namestring nullable
dataobject[] required

Response

OK

probabilitiesobject[] nullable
model_idstring uuid required
model_namestring required

Changes

No recorded changes to this operation across all 1 revision of this API.