Skip to content

Is there a way to retrieve all trained models during the trial, not just the ones in the best model? #1376

@DariaTkachova

Description

@DariaTkachova

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.

     def get_models_with_weights(self, models: BasePipeline) -> List[Tuple[float, BasePipeline]]:
    
      output = []
      for i, weight in enumerate(self.weights_):
          if weight > 0.0: #TODO: find a way around this
             identifier = self.identifiers_[i]
              model = models[identifier]
         output.append((weight, model))
    
      output.sort(reverse=True, key=lambda t: t[0])
    
      return output
    
  • 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:

     model_type, autosklearn_wrapped_model = model.steps[-1]
     model_dict['sklearn_model'] = autosklearn_wrapped_model.choice.estimator
    

System Details

OS: Mac BigSur
Using a Docker container environment
Python: 3.6.2
Auto-sklearn version: 0.13.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions