MultiModalPredictor.predict_proba¶
- MultiModalPredictor.predict_proba(data: DataFrame | dict | list, candidate_data: DataFrame | dict | list | None = None, id_mappings: Dict[str, Dict] | Dict[str, Series] | None = None, as_pandas: bool | None = None, as_multiclass: bool | None = True, realtime: bool | None = False)[source]¶
Predict class probabilities rather than class labels. Note that this is only for the classification tasks. Calling it for a regression task will throw an exception.
- Parameters:
data –
- The data to make predictions for. Should contain same column names as training data and
follow same format (except for the label column).
candidate_data – The candidate data from which to search the query data’s matches.
id_mappings – Id-to-content mappings. The contents can be text, image, etc. This is used when data contain the query/response identifiers instead of their contents.
as_pandas – Whether to return the output as a pandas DataFrame(Series) (True) or numpy array (False).
as_multiclass – Whether to return the probability of all labels or just return the probability of the positive class for binary classification problems.
realtime – Whether to do realtime inference, which is efficient for small data (default False). If provided None, we would infer it on based on the data modalities and sample number.
- Returns:
Array of predicted class-probabilities, corresponding to each row in the given data.
When as_multiclass is True, the output will always have shape (#samples, #classes).
Otherwise, the output will have shape (#samples,)