@Eduardo Your solution worked for me with one small change. Currently if you instantiate the class and then add new parameters via set_params()
, that change won't be reflected in get_params()
because they haven't been added to _param_names
. I added one line to fix this:
def set_params(self, **params):
for param, value in params.items():
setattr(self, param, value)
self._param_names.append(param)
return self
(Posted as an answer as I can't comment yet)