def test_can_get_only_core_and_all_objective_names(): all_objective_names = get_all_objective_names() core_objective_names = get_core_objective_names() assert set(all_objective_names).difference(core_objective_names) == { c.name.lower() for c in get_non_core_objectives() }
def _validate_objective(self, objective): non_core_objectives = get_non_core_objectives() if isinstance(objective, type): if objective in non_core_objectives: raise ValueError(f"{objective.name.lower()} is not allowed in AutoML! " "Use evalml.objectives.utils.get_core_objective_names() " "to get all objective names allowed in automl.") return objective() return objective