TabularPredictor.predict_proba_multi¶
- TabularPredictor.predict_proba_multi(data=None, models: List[str] | None = None, as_pandas: bool = True, as_multiclass: bool = True, transform_features: bool = True, inverse_transform: bool = True) dict [source]¶
Returns a dictionary of prediction probabilities where the key is the model name and the value is the model’s prediction probabilities on the data.
Equivalent output to: ``` predict_proba_dict = {} for m in models:
predict_proba_dict[m] = predictor.predict_proba(data, model=m)
Note that this will generally be much faster than calling self.predict_proba separately for each model because this method leverages the model dependency graph to avoid redundant computation.
- Parameters:
data (str or DataFrame, default = None) –
The data to predict on. If None:
If self.has_val, the validation data is used. Else, the out-of-fold prediction probabilities are used.
models (List[str], default = None) – The list of models to get predictions for. If None, all models that can infer are used.
as_pandas (bool, default = True) – Whether to return the output of each model as a pandas object (True) or numpy array (False). Pandas object is a DataFrame if this is a multiclass problem or as_multiclass=True, otherwise it is a Series. If the output is a DataFrame, the column order will be equivalent to predictor.class_labels.
as_multiclass (bool, default = True) –
- Whether to return binary classification probabilities as if they were for multiclass classification.
Output will contain two columns, and if as_pandas=True, the column names will correspond to the binary class labels. The columns will be the same order as predictor.class_labels.
If False, output will contain only 1 column for the positive class (get positive_class name via predictor.positive_class). Only impacts output for binary classification problems.
transform_features (bool, default = True) –
If True, preprocesses data before predicting with models. If False, skips global feature preprocessing.
This is useful to save on inference time if you have already called data = predictor.transform_features(data).
inverse_transform (bool, default = True) – If True, will return prediction probabilities in the original format. If False (advanced), will return prediction probabilities in AutoGluon’s internal format.
- Return type:
Dictionary with model names as keys and model prediction probabilities as values.