MultiModalPredictor.predict_proba#

MultiModalPredictor.predict_proba(data: Union[DataFrame, dict, list], candidate_data: Optional[Union[DataFrame, dict, list]] = None, id_mappings: Optional[Union[Dict[str, Dict], Dict[str, Series]]] = None, as_pandas: Optional[bool] = None, as_multiclass: Optional[bool] = True, realtime: Optional[bool] = None)[source]#

Predict probabilities class probabilities rather than class labels. 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 None). If not specified, 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,)