TabularPredictor.predict#
- TabularPredictor.predict(data, model=None, as_pandas=True, transform_features=True)[source]#
Use trained models to produce predictions of label column values for new data.
- Parameters
data (str or
TabularDataset
orpd.DataFrame
) – The data to make predictions for. Should contain same column names as training Dataset and follow same format (may contain extra columns that won’t be used by Predictor, including the label-column itself). If str is passed, data will be loaded using the str value as the file path.model (str (optional)) – The name of the model to get predictions from. Defaults to None, which uses the highest scoring model on the validation set. Valid models are listed in this predictor by calling predictor.get_model_names()
as_pandas (bool, default = True) – Whether to return the output as a
pd.Series
(True) ornp.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).
- Return type
Array of predictions, one corresponding to each row in given dataset. Either
np.ndarray
orpd.Series
depending on as_pandas argument.