tabensemb.model.RFE#
- class tabensemb.model.RFE(trainer: Trainer, modelbase: AbstractModel, model_subset=None, program=None, metric: str = 'Validation RMSE', impor_method: str = 'shap', cross_validation=5, min_features=1, **kwargs)[source]#
Bases:
TorchModelMethods
- __init__(trainer: Trainer, modelbase: AbstractModel, model_subset=None, program=None, metric: str = 'Validation RMSE', impor_method: str = 'shap', cross_validation=5, min_features=1, **kwargs)[source]#
- Parameters:
- trainer:
A
Trainerinstance 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_subsetandexclude_modelscan 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.
run(model_name[, verbose])Get names of all available models implemented in the model base.
Get the default name of the model base.
_new_model(model_name, verbose, **kwargs)Generate a new selected model based on kwargs.
_predict(df, model_name[, derived_data])Make prediction based on a tabular dataset using the selected model.
_predict_all(**kwargs)Make inferences on training/validation/testing datasets to evaluate the performance of all models.
_train([verbose, model_subset, warm_start])The basic framework of training models, including processing the dataset, training each model (with/without bayesian hyperparameter optimization), and evaluating them on the dataset.