-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Is there a way to retrieve all trained models during the trial, not just the ones in the best model? #1376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @DariaTkachova, This is not very intuitive but I am currently working on a reworked backend that should make all these model based queries much simpler in the future. For now, I would refer you to issue #1206, specifically this reply. This is how you can load any of the particular models that were trained. Is there any particular reason you need the Autosklearn wrapper versions of the estimators and not the P.S. Python 3.6 has reached it's end of life so future version will stop explicitly supporting it, they may however still work for a while. Best, |
Thank you for getting back to me. Are the other Autosklearn generated models being saved and how can they be retrieved/accessed? From our understanding, autosklearn works as follows:
From the approach you suggest, we were only able to retrieve the 14, and not the other 86. Is there a way to retrieve the ones fitted but not selected as ensemble? Example code:
Output:
Re: Is there any particular reason you need the Autosklearn wrapper versions of the estimators and not the sklearn estimators in show_models()?We do prefer to use the sklearn estimators / models as opposed to the autosklearn wrapped models, however we need to be able to pre-process data as is done by autosklearn. Do you perhaps have an example of how this may be done using show_models()? |
Hi @DariaTkachova, apologies for the delayed reply. Regarding accessing models that were not included in the ensemble, this is currently not intuitive to do and unlikely to bring you much better results. Furthermore, the backend has been rewritten and will likely have a much different API by the end of this month, to facilitate exactly these kind of requests. However, if urgent:
We do some minor transformations before data is passed to the pipeline in If you follow the code through |
Thank you kindly for the feedback. import re
seed = 42
for model_details in clf.automl_._backend.list_all_models(seed):
budget = re.search(r"(?<=\_).+?(?=\/)", model_details)
budget = budget.group()
budget = float(budget[budget.index("_") + 1 :])
model_id = re.search(r"(?<=\_).+?(?=\_)", model_details)
model_id = int(model_id.group())
backend = clf.automl_._backend
model = backend.load_model_by_seed_and_id_and_budget(seed, model_id, budget) Kind regards |
Hi @DariaTkachova, Glad to hear you got it to work, this snippet will prove helpful for anyone else who has similar questions :) Best, |
Uh oh!
There was an error while loading. Please reload this page.
Short Question Description
We need an alternative method to sklearn_ensemble.get_models_with_weights() to retrieve all trained models.
Please also kindly confirm if the auto-sklearn ensemble contain all the trained models.
Extra context
We found that the function get_models_with_weights() retrieves trained models with weights above zero, but would like to retrieve all models generated by auto-sklearn during a trial run.
The new show_models() function which would return a dictionary of models in ensemble as described in: Changes show_models() function to return a dictionary of models in ensemble #1321 returns an estimator not the actual model as per the code snippet below:
System Details
OS: Mac BigSur
Using a Docker container environment
Python: 3.6.2
Auto-sklearn version: 0.13.0
The text was updated successfully, but these errors were encountered: