You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was looking around in the code for a way to instantiate an sklearn model based on a Configuration object. My use-case is that I try to implement a generalized way of getting standard metadata about a completed autosklearn run. Eg, I call autosklearn_model.get_models_with_weights() and that ends up containing some Configuration objects. But these may for example just describe an sklearn model, although I understand it is possible to extend and register other model types as well. In either case I guess I would like access to an instance of the model with matching configuration, so that I can try calling get_params() on it to see if it supports that interface. Maybe this is simply accessible somewhere else, but my idea was to re-instantiate a dummy model based on the Configuration, and then do this calling of get_params(). Ideal would be that I could dynamically instantiate whatever model is described by the __choice__ (even if it's not sklearn), according to however autosklearn does it internally.
I was expecting to find though some place where this import is dynamically selected based on choice, but maybe this is just a wrapper class and is itself chosen dynamically?
And I want something that produces the equivalent of this (but without hard-coding the model choice and removing parameters that sklearn doesn't like etc):
Regarding your second request, unfortunately, this won't be easy as we have re-defined a lot of hyperparameters to have a different meaning than in sklearn and also introduce a lot of them ourselves.
I was looking around in the code for a way to instantiate an sklearn model based on a
Configuration
object. My use-case is that I try to implement a generalized way of getting standard metadata about a completed autosklearn run. Eg, I callautosklearn_model.get_models_with_weights()
and that ends up containing someConfiguration
objects. But these may for example just describe an sklearn model, although I understand it is possible to extend and register other model types as well. In either case I guess I would like access to an instance of the model with matching configuration, so that I can try callingget_params()
on it to see if it supports that interface. Maybe this is simply accessible somewhere else, but my idea was to re-instantiate a dummy model based on theConfiguration
, and then do this calling ofget_params()
. Ideal would be that I could dynamically instantiate whatever model is described by the__choice__
(even if it's not sklearn), according to however autosklearn does it internally.I was poking around in the code and found eg
auto-sklearn/autosklearn/pipeline/components/classification/random_forest.py
Line 46 in bb8396b
I was expecting to find though some place where this import is dynamically selected based on
choice
, but maybe this is just a wrapper class and is itself chosen dynamically?Then bits like this:
auto-sklearn/test/test_pipeline/components/classification/test_base.py
Lines 279 to 283 in bb8396b
Could you point me in the right direction? Or advise if I am missing some fundamental point about how this should work.
To make sure I am clear above I'll also include an example. I have a
config
object like this:And I want something that produces the equivalent of this (but without hard-coding the model choice and removing parameters that sklearn doesn't like etc):
The text was updated successfully, but these errors were encountered: