tabensemb.model.TorchModel._predict#

method

TorchModel._predict(df: DataFrame, model_name: str, derived_data: Dict | None = None, model: Any | None = None, **kwargs) ndarray#

Make prediction based on a tabular dataset using the selected model.

Parameters:
df:

A new tabular dataset that has the same structure as self.trainer.datamodule.X_test.

model_name:

A name of a selected model, which is already trained. It is used to process the input data if any specific routine is defined for this model in _data_preprocess().

derived_data:

Unstacked data derived from tabensemb.data.datamodule.DataModule.derive_unstacked() that has the same structure as self.trainer.datamodule.D_test.

model:

The model returned by _new_model(). If None, the model will be loaded from self.model.

**kwargs:

Ignored.

Returns:
np.ndarray

Prediction of the target.