def _get_params()

in orbit/utils/params_tuning.py [0:0]


    def _get_params(model):
        init_args_tmpl = dict()
        init_args = dict()

        # get all the signatures in the hierarchy of model templates
        for cls in inspect.getmro(model._model.__class__):
            sig = inspect.signature(cls)
            for key in sig.parameters.keys():
                if key != "kwargs":
                    if hasattr(model._model, key):
                        init_args_tmpl[key] = getattr(model._model, key)
        # get all the signatures in the hierarchy of forecaster
        for cls in inspect.getmro(model.__class__):
            sig = inspect.signature(cls)
            for key in sig.parameters.keys():
                if key != "kwargs":
                    if hasattr(model, key):
                        init_args[key] = getattr(model, key)
        # deal with the estimator separately
        for cls in inspect.getmro(model.estimator_type):
            sig = inspect.signature(cls)
            for key in sig.parameters.keys():
                if key != "kwargs":
                    if hasattr(model.estimator, key):
                        init_args[key] = getattr(model.estimator, key)

        return init_args_tmpl.copy(), init_args.copy()