utils ================================= .. py:module:: evalml.objectives.utils .. autoapi-nested-parse:: Utility methods for EvalML objectives. Module Contents --------------- Functions ~~~~~~~~~ .. autoapisummary:: :nosignatures: evalml.objectives.utils.get_all_objective_names evalml.objectives.utils.get_core_objective_names evalml.objectives.utils.get_core_objectives evalml.objectives.utils.get_non_core_objectives evalml.objectives.utils.get_objective Contents ~~~~~~~~~~~~~~~~~~~ .. py:function:: get_all_objective_names() Get a list of the names of all objectives. :returns: Objective names :rtype: list (str) .. py:function:: get_core_objective_names() Get a list of all valid core objectives. :returns: Objective names. :rtype: list[str] .. py:function:: get_core_objectives(problem_type) Returns all core objective instances associated with the given problem type. Core objectives are designed to work out-of-the-box for any dataset. :param problem_type: Type of problem :type problem_type: str/ProblemTypes :returns: List of ObjectiveBase instances .. rubric:: Examples >>> for objective in get_core_objectives("regression"): ... print(objective.name) ExpVariance MaxError MedianAE MSE MAE R2 Root Mean Squared Error >>> for objective in get_core_objectives("binary"): ... print(objective.name) MCC Binary Log Loss Binary Gini AUC Precision F1 Balanced Accuracy Binary Accuracy Binary .. py:function:: get_non_core_objectives() Get non-core objective classes. Non-core objectives are objectives that are domain-specific. Users typically need to configure these objectives before using them in AutoMLSearch. :returns: List of ObjectiveBase classes .. py:function:: get_objective(objective, return_instance=False, **kwargs) Returns the Objective class corresponding to a given objective name. :param objective: Name or instance of the objective class. :type objective: str or ObjectiveBase :param return_instance: Whether to return an instance of the objective. This only applies if objective is of type str. Note that the instance will be initialized with default arguments. :type return_instance: bool :param kwargs: Any keyword arguments to pass into the objective. Only used when return_instance=True. :type kwargs: Any :returns: ObjectiveBase if the parameter objective is of type ObjectiveBase. If objective is instead a valid objective name, function will return the class corresponding to that name. If return_instance is True, an instance of that objective will be returned. :raises TypeError: If objective is None. :raises TypeError: If objective is not a string and not an instance of ObjectiveBase. :raises ObjectiveNotFoundError: If input objective is not a valid objective. :raises ObjectiveCreationError: If objective cannot be created properly.