<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_valid_keys(self, obj):
 """ Given a dict of hyperparameter settings, throw an exception if any keys are not defined in this HyperparameterDefaults instance. """

        invalid_keys = [
            x for x in obj if x not in self.defaults
        ]
        if invalid_keys:
            raise ValueError(
                "No such model parameters: %s. Valid parameters are: %s"
                % (" ".join(invalid_keys),
                    " ".join(self.defaults)))