Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ardunn committed Oct 11, 2019
1 parent 0617c5e commit b628b59
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 5 additions & 1 deletion automatminer/automl/adaptors.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ class TPOTAdaptor(DFMLAdaptor, LoggableMixin):
best_models (OrderedDict): The best model names and their scores.
backend (TPOTBase): The TPOT object interface used for ML training.
models (OrderedDict): The raw sklearn-style models output by TPOT.
from_serialized (bool): Whether the backend is loaded from a serialized
instance. If True, the previous full TPOT data will not be available
due to pickling problems.
"""

def __init__(self, logger=True, **tpot_kwargs):
Expand All @@ -80,7 +84,7 @@ def __init__(self, logger=True, **tpot_kwargs):
self._features = None
self.logger = logger

self._from_serialized = False
self.from_serialized = False
self._best_models = None

@log_progress(AMM_LOG_FIT_STR)
Expand Down
11 changes: 8 additions & 3 deletions automatminer/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,12 @@ def load(cls, filename, logger=True):
pipe.logger = logger

pipe.logger.info("Loaded MatPipe from file {}.".format(filename))
pipe.logger.warning("Only use this model to make predictions (do not "
"retrain!). Backend was serialzed as only the top "
"model, not the full automl backend. ")

if hasattr(pipe.learner, "from_serialized"):
if pipe.learner._from_serialized:
pipe.logger.warning(
"Only use this model to make predictions (do not "
"retrain!). Backend was serialzed as only the top model, "
"not the full automl backend. "
)
return pipe

0 comments on commit b628b59

Please # to comment.