tabensemb.model.AbstractModel.inspect_attr#

method

AbstractModel.inspect_attr(model_name: str, attributes: List[str], df=None, derived_data=None, to_numpy=True) Dict[str, Any][source]#

Get attributes of the model after evaluating the model on training, validation, and testing sets respectively. If df is given, values after evaluating the given set are returned.

Parameters:
model_name

The name of the inspected model.

attributes

The requested attributes. If the model does not have the attribute, None is returned.

df

The tabular dataset.

derived_data:

Unstacked data derived from tabensemb.data.datamodule.DataModule.derive_unstacked(). If None, unstacked data will be re-derived.

to_numpy

If True, call numpy() if the attribute is a torch.Tensor.

Returns:
dict

A dict with keys train, val, and test if df is not given, and each value contains the attributes requested. If df is given, a dict with a single key USER_INPUT and the corresponding value contains the attributes. The prediction is also included with the key prediction.