Open
Description
When the best model is Ensemble, and you reload the model from a results path, calling need_retrain
on the model results in the following error
File "/Users/zachtindall/Documents/repos/ml-build/.venv/lib/python3.11/site-packages/supervised/automl.py", line 565, in need_retrain
return self._need_retrain(X, y, sample_weight, decrease)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/zachtindall/Documents/repos/ml-build/.venv/lib/python3.11/site-packages/supervised/base_automl.py", line 2479, in _need_retrain
metric = self._best_model.get_metric()
If I call load
manually on the model after it has been initialized, then it works as intended.
Example
auto_ml = AutoML(
results_path=self._results_path,
)
auto_ml.load(self._results_path)
need_retrain = auto_ml.need_retrain(
x_test, y_test, sample_weight=sample_weight, decrease=decrease
)
I wouldn't expect that load would need to be called manually, since other methods like predict
can be called right after initializing a model from a results path