TabularPredictor.predict_multi¶
- TabularPredictor.predict_multi(data: DataFrame = None, models: list[str] = None, as_pandas: Literal[True] = True, transform_features: bool = True, inverse_transform: bool = True, decision_threshold: float = None) dict[str, Series][source]¶
- TabularPredictor.predict_multi(data: DataFrame = None, models: list[str] = None, *, as_pandas: Literal[False], transform_features: bool = True, inverse_transform: bool = True, decision_threshold: float = None) dict[str, ndarray]
- Returns a dictionary of predictions where the key is the model name and the value is the model’s prediction probabilities on the data. - Equivalent output to: ``` predict_dict = {} for m in models: - predict_dict[m] = predictor.predict(data, model=m) - Note that this will generally be much faster than calling - TabularPredictor.predict()separately for each model because this method leverages the model dependency graph to avoid redundant computation.- Parameters:
- data (DataFrame, default = None) – - The data to predict on. If None: 
- 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 - pd.Series(True) or- np.ndarray(False).
- 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 predictions in the original format. If False (advanced), will return predictions in AutoGluon’s internal format. 
- decision_threshold (float, default = None) – The decision threshold used to convert prediction probabilities to predictions. Only relevant for binary classification, otherwise ignored. If None, defaults to 0.5. Valid values are in the range [0.0, 1.0] You can obtain an optimized decision_threshold by first calling - TabularPredictor.calibrate_decision_threshold(). Useful to set for metrics such as balanced_accuracy and f1 as 0.5 is often not an optimal threshold. Predictions are calculated via the following logic on the positive class: 1 if pred > decision_threshold else 0
 
- Returns:
- Dictionary with model names as keys and model predictions as values. 
- Return type:
- dict[str, pd.Series] | dict[str, np.ndarray]