Repository: autogluon/autogluon

Issue:
[BUG]  PR #1956 using arg `refit_full=True` for `predictor.fit_weighted_ensemble()` Gets **Inconsistent Return**
- [x] I have checked that this bug exists on the latest stable version of AutoGluon
- [x] and/or I have checked that this bug exists on the latest mainline of AutoGluon via source installation

**Describe the bug**
Get inconsistent output when using `predictor.fit_weighted_ensemble(base_models, refit_full=True)`
, which is a feature enhancement in https://github.com/awslabs/autogluon/pull/1956 

https://github.com/awslabs/autogluon/blob/74a3d6006c25ec49dfd1729e55c200548c3ba0d1/tabular/src/autogluon/tabular/predictor/predictor.py#L2267-L2268

`models` is the return of `predictor.fit_weighted_ensemble()`, which is expected to be a list of model names.
However, `self.refit_full()` returns a dictionary original models names -> refit_full model names.

**Expected behavior**
Line #2267-2268, imo, should be 
```Python
    if refit_full: 
        ori_full_dict = self.refit_full(model=models)
        models += [ori_full_dict[m] for m in models]
```

**To Reproduce**
https://gist.github.com/lujiaying/8a4ebe772fef7a90f3295ead84b93288

```
from autogluon.tabular import TabularPredictor, TabularDataset


if __name__ == '__main__':
    path_prefix = 'https://autogluon.s3.amazonaws.com/datasets/CoverTypeMulticlassClassification/'
    path_train = path_prefix + 'train_data.csv'
    path_test = path_prefix + 'test_data.csv'

    label = 'Cover_Type'
    sample = 20000  # Number of rows to use to train
    train_data = TabularDataset(path_train)

    if sample is not None and (sample < len(train_data)):
        train_data = train_data.sample(n=sample, random_state=0).reset_index(drop=True)

    test_data = TabularDataset(path_test)

    fit_kwargs = dict(
        train_data=train_data,
        hyperparameters={
            'NN_TORCH': {},
            'GBM': {},
            'KNN': {},
        },
        presets='high_quality',
        time_limit=120,
        num_bag_folds=3,
        num_bag_sets=2,
    )

    predictor = TabularPredictor(
        label=label,
        eval_metric='log_loss',
    )

    predictor.fit(**fit_kwargs)
    predictor.leaderboard()
    predictor.persist_models('all')

    # works well
    we_model = predictor.fit_weighted_ensemble(base_models=['KNeighbors_BAG_L1', 'LightGBM_BAG_L1'], name_suffix='trial1')
    print(f'we_model={we_model}, expect ["WeightedEnsemble_L2_trial1"]')

    # not as expect
    we_model_refit = predictor.fit_weighted_ensemble(base_models=['KNeighbors_BAG_L1', 'LightGBM_BAG_L1'], name_suffix='trial2', refit_full=True)
    print(f'we_model_refit={we_model_refit}, expect ["WeightedEnsemble_L2_trial2_FULL"]')

    predictor.leaderboard()
```

**Screenshots**
If applicable, add screenshots to help explain your problem.
```
Fitting model: WeightedEnsemble_L2trial1 ...
	-0.4063	 = Validation score   (-log_loss)
	2.48s	 = Training   runtime
	0.01s	 = Validation runtime
we_model=['WeightedEnsemble_L2trial1'], expect "WeightedEnsemble_L2_trial1"

Fitting model: WeightedEnsemble_L2trial2 ...
	-0.4063	 = Validation score   (-log_loss)
	2.48s	 = Training   runtime
	0.01s	 = Validation runtime
we_model_refit=['WeightedEnsemble_L2trial2', 'KNeighbors_BAG_L1', 'LightGBM_BAG_L1', 'NeuralNetTorch_BAG_L1', 'WeightedEnsemble_L2', 'LightGBM_BAG_L2', 'NeuralNetTorch_BAG_L2', 'WeightedEnsemble_L3', 'WeightedEnsemble_L2trial2'], expect "WeightedEnsemble_L2_trial2_FULL"
```


**Installed Versions**
Which version of AutoGluon are you are using?  
If you are using 0.4.0 and newer, please run the following code snippet:
<details>

```python
# Replace this code with the output of the following:
from autogluon.core.utils import show_versions
show_versions()
```

</details>

```
INSTALLED VERSIONS
------------------
date                   : 2022-07-19
time                   : 19:53:44.025656
python                 : 3.9.12.final.0
OS                     : Linux
OS-release             : 5.4.196-119.356.amzn2int.x86_64
Version                : #1 SMP Wed May 25 23:50:13 UTC 2022
machine                : x86_64
processor              : x86_64
num_cores              : 16
cpu_ram_mb             : 62847
cuda version           : None
num_gpus               : 0
gpu_ram_mb             : []
avail_disk_size_mb     : 230643

autogluon.common       : 0.5.1b20220712
autogluon.core         : 0.5.1b20220712
autogluon.features     : 0.5.1b20220712
autogluon.multimodal   : 0.5.1b20220712
autogluon.tabular      : 0.5.1b20220712
autogluon.text         : 0.5.1b20220712
autogluon.timeseries   : 0.5.1b20220712
autogluon.vision       : 0.5.1b20220712
autogluon_contrib_nlp  : 0.0.1
boto3                  : 1.21.21
catboost               : 1.0.5
dask                   : 2021.11.2
distributed            : 2021.11.2
fairscale              : 0.4.6
fastai                 : 2.5.6
gluoncv                : 0.11.0
gluonts                : 0.9.4
hyperopt               : 0.2.7
lightgbm               : 3.3.2
matplotlib             : 3.5.2
networkx               : 2.8
nlpaug                 : 1.1.10
nltk                   : 3.7
nptyping               : 1.4.4
numpy                  : 1.21.6
omegaconf              : 2.1.2
pandas                 : 1.3.5
PIL                    : 9.0.1
protobuf               : None
psutil                 : 5.8.0
pytorch-metric-learning: None
pytorch_lightning      : 1.5.10
ray                    : 1.13.0
requests               : 2.27.1
scipy                  : 1.7.3
sentencepiece          : None
skimage                : 0.19.2
sklearn                : 1.0.2
smart_open             : 5.2.1
timm                   : 0.5.4
torch                  : 1.10.2+cu102
torchmetrics           : 0.7.3
tqdm                   : 4.64.0
transformers           : 4.20.1
xgboost                : 1.4.2
```

**Additional context**
Add any other context about the problem here.



Discussion:

Resolving patch:
diff --git a/tabular/src/autogluon/tabular/predictor/predictor.py b/tabular/src/autogluon/tabular/predictor/predictor.py
--- a/tabular/src/autogluon/tabular/predictor/predictor.py
+++ b/tabular/src/autogluon/tabular/predictor/predictor.py
@@ -3364,7 +3364,8 @@ def fit_weighted_ensemble(self, base_models: list = None, name_suffix="Best", ex
         )
 
         if refit_full:
-            models += self.refit_full(model=models)
+            refit_models_dict = self.refit_full(model=models)
+            models += [refit_models_dict[m] for m in models]
 
         return models
 


Test patch: