tabensemb.model.WideDeep#

class tabensemb.model.WideDeep(*args, **kwargs)[source]#

Bases: AbstractModel

Methods

__init__(*args, **kwargs)[source]#
Parameters:
trainer:

A Trainer instance that contains all information and datasets and will be linked to the model base. The trainer has loaded configs and data.

program:

The name of the model base. If None, the name from _get_program_name() is used.

model_subset:

The names of models selected to be trained in the model base.

exclude_models:

The names of models that should not be trained. Only one of model_subset and exclude_models can be specified.

store_in_harddisk:

Whether to save models in the hard disk. If the global setting tabensemb.setting["low_memory"] is True, True is used.

optimizers

A dictionary of optimizer names (choose from those in torch.optim) and their hyperparameters for each model. Remember to change _initial_values() and _space() to optimize its hyperparameters.

lr_schedulers

A dictionary of lr scheduler names (choose from those in torch.optim.lr_scheduler) and their hyperparameters for each model. Remember to change _initial_values() and _space() to optimize its hyperparameters.

**kwargs:

Ignored.

_data_preprocess(df, derived_data, model_name)

Perform the same preprocessing as in _train_data_preprocess() on a new dataset.

_get_model_names()

Get names of all available models implemented in the model base.

_get_program_name()

Get the default name of the model base.

_initial_values(model_name)

Initial values of hyperparameters to be optimized.

_new_model(model_name, verbose, **kwargs)

Generate a new selected model based on kwargs.

_pred_single_model(model, X_test, verbose, ...)

Predict using the model trained in _train_single_model().

_space(model_name)

Spaces are selected around default parameters.

_train_data_preprocess(model_name[, warm_start])

Processing the data from self.trainer.datamodule for training.

_train_single_model(model, model_name, ...)

pytorch_widedeep uses an approximated loss calculation procedure that calculates the average loss across batches, which is not what we do (in a precise way for MSE) at the end of training and makes results from the callback differ from our final metrics.