TabularPredictor.load¶
- classmethod TabularPredictor.load(path: str, verbosity: int | None = None, require_version_match: bool = True, require_py_version_match: bool = True, check_packages: bool = False) TabularPredictor [source]¶
Load a TabularPredictor object previously produced by fit() from file and returns this object. It is highly recommended the predictor be loaded with the exact AutoGluon version it was fit with.
Warning
autogluon.tabular.TabularPredictor.load()
uses pickle module implicitly, which is known to be insecure. It is possible to construct malicious pickle data which will execute arbitrary code during unpickling. Never load data that could have come from an untrusted source, or that could have been tampered with. Only load data you trust.- Parameters:
path (str) – The path to directory in which this Predictor was previously saved.
verbosity (int, default = None) – Sets the verbosity level of this Predictor after it is loaded. Valid values range from 0 (least verbose) to 4 (most verbose). If None, logging verbosity is not changed from existing values. Specify larger values to see more information printed when using Predictor during inference, smaller values to see less information. Refer to TabularPredictor init for more information.
require_version_match (bool, default = True) – If True, will raise an AssertionError if the autogluon.tabular version of the loaded predictor does not match the installed version of autogluon.tabular. If False, will allow loading of models trained on incompatible versions, but is NOT recommended. Users may run into numerous issues if attempting this.
require_py_version_match (bool, default = True) –
- If True, will raise an AssertionError if the Python version of the loaded predictor does not match the installed Python version.
Micro version differences such as 3.9.2 and 3.9.7 will log a warning but will not raise an exception.
If False, will allow loading of models trained on incompatible python versions, but is NOT recommended. Users may run into numerous issues if attempting this.
check_packages (bool, default = False) – If True, checks package versions of the loaded predictor against the package versions of the current environment. Warnings will be logged for each mismatch of package version.
- Returns:
predictor
- Return type:
Examples
>>> predictor = TabularPredictor.load(path_to_predictor)