コード例 #1
0
ファイル: test_objectives.py プロジェクト: skvorekn/evalml
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()
    }
コード例 #2
0
 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